From: twhite at goldenspiral dot us
Operating system: Windows XP
PHP version: 5.3SVN-2009-08-12 (snap)
PHP Bug Type: OCI8 related
Bug description: oci_bind_array_by_name does not work with associative arrays
Description:
------------
oci_bind_array_by_name only works on arrays with numeric indices, and not
on associative arrays. Oracle 9+ supports associative array data types
indexed by varchar2.
Configure line:
cscript /nologo configure.js "--enable-snapshot-build"
"--enable-debug-pack" "--disable-isapi"
"--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared"
"--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"
"--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared"
Reproduce code:
---------------
/* PHP */
$conn = oci_connect($username, $password, $database);
$rows = array(
'COL1' => 'foo',
'COL2' => 'baz',
'COL3' => 'bar'
);
$s = oci_parse($conn, "begin ARRAY_BIND_TEST.INSERT_PROC(:a); end;");
oci_bind_array_by_name($s, ":a", $rows, count($rows), -1, SQLT_CHR);
oci_execute($s);
/* Oracle */
create or replace
package ARRAY_BIND_TEST as
type array_assoc is table of varchar2(500) index by varchar2(4000);
procedure INSERT_PROC(p_arr in array_assoc);
end ARRAY_BIND_TEST;
create or replace
package body ARRAY_BIND_TEST as
procedure INSERT_PROC(p_arr in array_assoc) is
begin
insert into ZZZ_TEST_TABLE (col1, col2, col3)
values (
p_arr('COL1'),
p_arr('COL2'),
p_arr('COL3')
);
end INSERT_PROC;
end ARRAY_BIND_TEST;
Expected result:
----------------
I am expecting the stored procedure to execute.
Actual result:
--------------
Warning: oci_execute() [function.oci-execute]: ORA-06550: line 1, column
7: PLS-00306: wrong number or types of arguments in call to 'INSERT_PROC'
ORA-06550: line 1, column 7: PL/SQL: Statement ignored in ...
--
Edit bug report at http://bugs.php.net/?id=49239&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49239&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49239&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49239&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49239&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=49239&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49239&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=49239&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=49239&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=49239&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=49239&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=49239&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=49239&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=49239&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49239&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49239&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49239&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=49239&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=49239&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=49239&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=49239&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=49239&r=mysqlcfg