| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2007-01-11 11:28 UTC] tony2001@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 15:00:01 2025 UTC | 
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