将数组发送到 PL/SQL 过程
我创建了一个 Web 服务来将一堆信息发送到 PL/SQL 过程,但其中一个是数组。 我为此使用什么类型? 我还想在该数组进入后将其放入游标中。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有任何 PL/SQL 经验,如果这不适用,我很抱歉。 在 MS SQL 2000/2005 中,没有办法将数组传递到过程中; 我假设 PL/SQL 也有类似的限制。 我过去使用的解决方法是传入一个分隔字符串(通常是管道分隔,因为数据中存在逗号),然后有一个函数可以接受分隔字符串并将其分解为一个表结果每个值的行。 然后在您的过程中,您只需调用 split 函数并向其传递分隔字符串,您就可以得到一个表结果,您可以使用它执行任何您想要的操作(光标悬停、连接到其他表等)。
编辑:刚刚在谷歌上搜索了“PL/SQL 表参数”并得到了一些点击; 可能值得调查一下,看看这些结果是否可以帮助您。
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.
此链接可能有用。 或者,您可以按照其他发帖人所说的操作,将数据序列化为字符串,传递它,然后在另一端将其反序列化。
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.