ID:               40078
 Updated by:       [EMAIL PROTECTED]
 Reported By:      fsurleau at skyservices dot net
-Status:           Assigned
+Status:           Closed
 Bug Type:         OCI8 related
 Operating System: RedHat EL4
 PHP Version:      5.2.1RC2
 Assigned To:      tony2001
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2007-01-09 17:11:50] fsurleau at skyservices dot net

Description:
------------
When the returned Oracle table contains at least one NULL,
oci_execute() fails: ORA-01405: fetched column value is NULL.

Regards,
Fred.

Reproduce code:
---------------
<?php
$c = oci_connect("scott", "tiger");

$create_pkg = "
CREATE OR REPLACE PACKAGE ARRAYBINDPKG1 AS
    TYPE ARRTYPE IS TABLE OF VARCHAR(20) INDEX BY BINARY_INTEGER;
    PROCEDURE nullbind(c1 OUT ARRTYPE);
END ARRAYBINDPKG1;";
$statement = oci_parse($c, $create_pkg);
oci_execute($statement);

$create_pkg_body = "
CREATE OR REPLACE PACKAGE BODY ARRAYBINDPKG1 AS
    PROCEDURE nullbind(c1 OUT ARRTYPE) IS
    BEGIN
        c1(1) := 'one';
        c1(2) := 'two';
        c1(3) := '';   -- <= This cause ORA-01405
        c1(4) := 'four';
        c1(5) := 'five';
    END nullbind;
END ARRAYBINDPKG1;";
$statement = oci_parse($c, $create_pkg_body);
oci_execute($statement);

$statement = oci_parse($c, "BEGIN ARRAYBINDPKG1.nullbind(:c1); END;");

oci_bind_array_by_name($statement, ":c1", $array, 5, 20, SQLT_CHR);

oci_execute($statement);

var_dump($array);
?>


Expected result:
----------------
array(5) { [0]=>  string(3) "one" [1]=>  string(3) "two" [2]=> 
string(1) "" [3]=>  string(4) "four" [4]=>  string(4) "five" }

Actual result:
--------------
oci_execute() [function.oci-execute]: ORA-01405


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40078&edit=1

Reply via email to