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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dv at allyoucanthink dot de
New email:
PHP Version: OS:

 

 [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
 [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: Tue Apr 16 09:01:28 2024 UTC