简体   繁体   中英

500 error when select clob field in oracle 11g

When iam running my oracle query showing 500 error in server. The error showing when selecting clob field in oracle query.The field contains big json data

Error is:

HTTP Error 500.0 - Internal Server Error C:\\php7.0.3\\php-cgi.exe - The FastCGI process exited unexpectedly

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

(query running in 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.

is this code problem or server problem? But this code is working perfectly in my local wamp server not in online server.

I need help !

Have you tried querying only one clob field from concrete table?

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

$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.

By setting this, it will be same behavior as mysql even fetching from oracle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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