|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40785 Error trying to insert into CLOB column using PDO_OCI and Streams.
Submitted: 2007-03-12 16:22 UTC Modified: 2016-03-08 01:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: jarismar at adplabs dot com dot br Assigned: sixd (profile)
Status: Not a bug Package: PDO OCI
PHP Version: 5.2.1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jarismar at adplabs dot com dot br
New email:
PHP Version: OS:


 [2007-03-12 16:22 UTC] jarismar at adplabs dot com dot br
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);

  $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);


} catch (Exception $oE) {
  print $oE->getMessage()."\n";
$oPDO = null;

Expected result:
No error or exception should occurs.

Actual result:
    [0] => HY000
    [1] => 932
    [2] => OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BLOB got CLOB


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-27 11:25 UTC] eugene dot pikalov at gmail dot com
 [2007-09-03 14:23 UTC]
Assigned to the pdo_oci maintainer.
 [2007-09-04 18:24 UTC]
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
That bug is waiting some PDO standardization to complete before CLOB support is added.
 [2016-03-08 01:42 UTC]
-Package: PDO related +Package: PDO OCI
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 02:01:30 2024 UTC