我正在尝试将php数组传递给oracle过程,但它给我错误“在对“ procdure_name”的调用中参数的数目或类型错误
我遵循了 http://php.net/manual/en/function.oci-bind-array-by-name.php
我成功声明了类型
TYPE MY_T_ARRAY IS TABLE OF VARCHAR(20) INDEX BY BINARY_INTEGER;
而不是 类型MY_T_ARRAY是VARCHAR表(20);
当我声明像这样的类型时
TYPE MY_T_ARRAY IS TABLE OF VARCHAR(20) INDEX BY BINARY_INTEGER;
我无法在程序中选择
CREATE OR REPLACE PROCEDURE MYPKG
TYPE MY_T_ARRAY IS TABLE OF VARCHAR(20) INDEX BY BINARY_INTEGER;
TYPE REP_arr_t IS REF CURSOR;
PROCEDURE MYPROC(
p_type IN MY_T_ARRAY ,
p_CUR OUT REP_arr_t)
IS
BEGIN
OPEN p_CUR FOR SELECT * FROM XTABLE WHERE MYCOL IN (SELECT column_value FROM TABLE(p_TYPE);
END;
END;
这给了我错误:无法访问非嵌套表项中的行;
这是我的php代码:
$arr = array("A", "B");
oci_bind_array_by_name($s,':p_type', $arr, count($arr), -1, SQLT_CHR);