|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-27 11:25 UTC] eugene dot pikalov at gmail dot com
[2007-09-03 14:23 UTC] jani@php.net
[2007-09-04 18:24 UTC] sixd@php.net
[2016-03-08 01:42 UTC] sixd@php.net
-Package: PDO related
+Package: PDO OCI
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Description: ------------ Trying to inset into a CLOB field usint RETURNING column INTO sql syntax, results on the following error : OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BLOB got CLOB I've tested with Oracle 9i and 10g (both relases 10.1 and 10.2). Reproduce code: --------------- try { $oPDO = new PDO($sDSN, $sUserName, $sPassword); $oPDO->beginTransaction(); $oStmt = $oPDO->prepare( 'INSERT INTO test_clob (id,data) '. 'VALUES (:id, EMPTY_CLOB()) '. 'RETURNING data INTO :value'); if($oStmt === false) { print_r($oPDO->errorInfo()); } $iID = 1; if(!$oStmt->bindParam(':id', $iID)) { print_r($oStmt->errorInfo()); } $sData = str_repeat('x', 65535); if(!$oStmt->bindParam(':value', $resource, PDO::PARAM_LOB)) { print_r($oStmt->errorInfo()); } if(!$oStmt->execute()) {print_r($oStmt->errorInfo());} if (is_resource($resource)) { fwrite($resource, $sData); fclose($resource); } $oPDO->commit(); } catch (Exception $oE) { print $oE->getMessage()."\n"; } $oPDO = null; Expected result: ---------------- No error or exception should occurs. Actual result: -------------- Array ( [0] => HY000 [1] => 932 [2] => OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BLOB got CLOB (/oracle/applications/php-5.2.0/ext/pdo_oci/oci_statement.c:142) )