栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

将PHP数组传递到Oracle Stored Proc(PLS-00306:错误的参数数目或类型)

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

将PHP数组传递到Oracle Stored Proc(PLS-00306:错误的参数数目或类型)

答案是这样。您不能使用全局创建的或架构级别的类型作为存储过程的参数。PHP的oci_bind_array_by_name似乎不适用于全局创建的类型,但是您需要全局创建的类型才能将数组用作子选择中的嵌套表。所以....这就是我如何使它工作的。我非常高兴听到其他解决方案!!但是现在,这就是我所做的。

-- globally create a type table of numbercreate or replace type num_array is table of number;-- in my package i created an internal type table of numbertype i_num_array is table of number index by binary_integer;-- i then used i_num_array (internal type) as the type for my IN parameter to the procedureupsert_TXA_compliance_slct( v_compl_id_array  in i_num_array)-- in my procedure i also created a variable that is the type of my globally created typev_num_array num_array := num_array();-- then i populated that variable in a loop inside my procedure with the values in my IN paramfor i in 1 .. v_compl_id_array.countloop  v_num_array.extend(1);  v_num_array(i) := v_compl_id_array(i);end loop;-- then i used v_num_array as my nested table so this now works:delete from my_table where id in (select * from table(v_num_array));


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/441605.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号