php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57490 CLOB insert failed due to ORA-00932 error
Submitted: 2007-01-23 11:58 UTC Modified: -
From: dv at allyoucanthink dot de Assigned:
Status: Open Package: PDO_OCI (PECL)
PHP Version: 5.2.0 RC4 OS: irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-23 11:58 UTC] dv at allyoucanthink dot de
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)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-06 06:35 UTC] jabarthes_no_spam at free dot fr
Same problem with Version 5.1.4.4
 [2007-06-18 15:20 UTC] christopher dot jones at oracle dot com
Duplicate of http://pecl.php.net/bugs/bug.php?id=7943
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Sep 22 18:01:26 2019 UTC