|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-06 06:35 UTC] jabarthes_no_spam at free dot fr
[2007-06-18 15:20 UTC] christopher dot jones at oracle dot com
[2021-05-03 11:49 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Package: PDO_OCI
+Package: PDO OCI
-Assigned To:
+Assigned To: cmb
[2021-05-03 11:49 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 01:00:02 2025 UTC |
Description: ------------ it is unpossible insrt data into CLOB fields... BLOB inserts working fine Reproduce code: --------------- dl('pdo_oci.so'); $db = new PDO('oci:', 'scott', 'tiger'); /* CREATE TABLE CREDITS ( ID NUMBER, NAME VARCHAR(255), BLOBDATA BLOB, CLOBDATA CLOB ) */ $query = ' INSERT INTO CREDITS ( ID, NAME, BLOBDATA, CLOBDATA ) VALUES ( ?, ?, EMPTY_BLOB(), EMPTY_CLOB() ) RETURNING BLOBDATA, CLOBDATA INTO ?, ? '; $stmt = $db->prepare($query); if(!$stmt) { $r = $db->errorInfo(); print_r($r); exit; } $id = 555; $name = 'test'; $fp1 = fopen('PDO_OCI-1.0.tgz', 'rb'); $fp2 = fopen('file.txt', 'r'); $stmt->bindParam(1, $id); $stmt->bindParam(2, $name); $stmt->bindParam(3, $fp1, PDO::PARAM_LOB); $stmt->bindParam(4, $fp2, PDO::PARAM_LOB); $db->beginTransaction(); $r = $stmt->execute(); fclose($fp1); fclose($fp2); if(!$r) { print_r($stmt->errorInfo()); $db->rollback(); } else { $db->commit(); } Expected result: ---------------- values must be insterted in BLOB and CLOB fields as expected Actual result: -------------- execute failed due to following error - OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BLOB got CLOB (/tmp/pear/cache/PDO_OCI-1.0.1/oci_statement.c:142)