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: 2021-05-03 11:49 UTC
From: dv at allyoucanthink dot de Assigned: cmb (profile)
Status: Duplicate Package: PDO OCI
PHP Version: 5.2.0 RC4 OS: irrelevant
Private report: No CVE-ID: None
 [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

Pull Requests

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
 [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
Duplicate of bug #57095.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 05:01:29 2024 UTC