Sending an Array into a PL/SQL Procedure

偶尔善良 提交于 2019-12-25 04:33:45

问题


I have created a Web Service to send in a bunch of information to a PL/SQL procedure, however one of them is a array. What type do I use for this? I also want to put that array into a cursor after it comes in.


回答1:


I don't have any experience with PL/SQL, so sorry if this doesn't apply. In MS SQL 2000/2005, there isn't a way to pass arrays into a procedure; I'm assuming PL/SQL has a similar limitation. The workaround I've used in the past is to pass in a delimited string (usually pipe delimited because commas were present in the data), and then have a function that can take a delimited string and break it up into a table result with one row per value. Then inside your procedure, you just call your split function passing it the delimited string and you have a table result that you can do whatever you want with (cursor over, join to other tables, etc).

EDIT: Just did a google for "PL/SQL table parameter" and had a few hits; Might be worth investigating to see if any of those results can help you.




回答2:


This link might be of use. Or you can do what the other poster said and basically serialize your data into a string, pass it, and then unserialize it on the other end.



来源:https://stackoverflow.com/questions/627587/sending-an-array-into-a-pl-sql-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!