简体   繁体   English

在Oracle 11g中选择Clob字段时出现500错误

[英]500 error when select clob field in oracle 11g

When iam running my oracle query showing 500 error in server. 当iam运行我的oracle查询时,在服务器中显示500错误。 The error showing when selecting clob field in oracle query.The field contains big json data 在Oracle查询中选择Clob字段时显示的错误。该字段包含大json数据

Error is: 错误是:

HTTP Error 500.0 - Internal Server Error C:\\php7.0.3\\php-cgi.exe - The FastCGI process exited unexpectedly HTTP错误500.0-内部服务器错误C:\\ php7.0.3 \\ php-cgi.exe-FastCGI进程意外退出

here my query: 这是我的查询:

SELECT knowyour.*,
  kp.personal_details AS personal_details,
  kp.fullname,
  kcd.category,
  kcd.ID AS kycID
FROM
  (SELECT DISTINCT kc.kyc_reffer_id,
    kc.ID,
    kc.customer_id,
    kc.json_details AS json_details,
    kc.customer_joint_id,
    kc.customer_id AS kycCustomer_id
  FROM db.knwcustomer kc
  ) knowyour
INNER JOIN db.createdetails kcd
ON (knowyour.customer_id=kcd.customer_id)
INNER JOIN db.personaldetails kp
ON (knowyour.kyc_reffer_id=kp.kyc_reffer_id)
LEFT JOIN db.kaccountdetails kd
ON (knowyour.customer_id=kd.customer_id)

WHERE kcd.displayStatus!=:status
AND kcd.category=:category
AND kd.status!=:status
AND kp.status!=:status
AND kcd.client_id=:client_id
ORDER BY kcd.ID

here status = -1 状态= -1

(query running in php pdo) (在php pdo中运行的查询)

This is an example query. 这是一个示例查询。

personal_details and json_details are clob fields.Distinct will not work when selecting clob field that's why Iam using this query method. personal_details和json_details是Clob字段。选择Clob字段时,Distinct不起作用,这就是Iam使用此查询方法的原因。

is this code problem or server problem? 这是代码问题还是服务器问题? But this code is working perfectly in my local wamp server not in online server. 但是此代码在我的本地Wamp服务器而不是在线服务器中可以正常工作。

I need help ! 我需要帮助 !

Have you tried querying only one clob field from concrete table? 您是否尝试过仅查询具体表中的一个clob字段?

Like: 喜欢:

SELECT CLOB_FIELD 
FROM EX_TABLE;

If this will work, there is probably a problem in a query itself. 如果这行得通,则查询本身可能存在问题。 Your query is complex enough to hide some issues. 您的查询非常复杂,足以隐藏一些问题。

if you are using php with PDO then try set attribute as below 如果您在PDO中使用php,请尝试如下设置set属性

$dbConnection->setAttribute(PDO::ATTR_STRINGIFY_FETCHES,TRUE);

This will convert all columns to strings, regardless of their original type and this does not include NULL columns ,and does not translate data being inserted. 这会将所有列转换为字符串,而不管它们的原始类型如何,并且不包括NULL列,并且不转换要插入的数据。

By setting this, it will be same behavior as mysql even fetching from oracle. 通过设置该选项,即使从oracle获取,它的行为也与mysql相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM