#40785 [Asn->Bgs]: Error trying to insert into CLOB column using PDO_OCI and Streams.

From: Date: Tue, 04 Sep 2007 18:24:11 +0000
Subject: #40785 [Asn->Bgs]: Error trying to insert into CLOB column using PDO_OCI and Streams.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-117120@lists.php.net to get a copy of this message
ID: 40785 Updated by: sixd@php.net Reported By: jarismar at adplabs dot com dot br -Status: Assigned +Status: Bogus Bug Type: PDO related PHP Version: 5.2.1 Assigned To: sixd New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. -------- This is a duplicate of http://pecl.php.net/bugs/bug.php?id=7943 That bug is waiting some PDO standardization to complete before CLOB support is added. -------- Previous Comments: ------------------------------------------------------------------------ [2007-09-03 14:23:13] jani@php.net Assigned to the pdo_oci maintainer. ------------------------------------------------------------------------ [2007-04-27 11:25:07] eugene dot pikalov at gmail dot com http://pecl.php.net/bugs/bug.php?id=7943 ------------------------------------------------------------------------ [2007-03-12 16:22:07] jarismar at adplabs dot com dot br 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) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40785&edit=1

« previous php.bugs (#117120) next »