|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-10-24 07:50 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: sixd
+Assigned To:
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
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 ...