如何从 TOAD for Oracle 执行函数并将结果绑定到数据网格
我有一个函数,它将 pl/sql 对象的 VARRAY 作为其参数之一。如何执行此存储过程并将其返回的结果集绑定到 TOAD for Oracle 中的数据网格?
I have a function that takes as one of it's arguments a VARRAY of pl/sql Objects. How do I execute this stored procedure and bind the resultset that it returns to a data grid in TOAD for Oracle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番搜索后,我找到了自己问题的答案。假设您的 varray 类型称为 varchar_pair_array,并且存储在该数组中的对象称为 varchar_pair_object。 varchar_pair_object 是一个简单的对象,有两个 varchar 作为其成员。
以下是执行接受 varchar_pair_object (s) 变量数组的过程的代码:
将此代码复制粘贴到 TOAD 的 sql 编辑器中,并更改它以适应您的函数和类型,然后按 F9。 TOAD 会询问您 :to_grid 变量的类型。选择光标(假设您的函数返回引用光标)并按 Enter 键。 TOAD 会将结果集绑定到数据网格。
对我有帮助的链接:
http://www. smart-soft.co.uk/Oracle/oracle-plsql-tutorial-part-11.htm(关于集合的很好的教程)
http://download.oracle.com/docs /cd/B10501_01/appdev.920/a96624/10_objs.htm#1972(在这种情况下特别有用的是关于声明和初始化对象的部分)
只需很少的更改就可以通过过程完成相同的工作。
After some searching around, I found the answer to my own problem. Say your varray type was called varchar_pair_array and the objects stored in this array were called varchar_pair_object. varchar_pair_object is a simple object that has two varchars as it's members.
Here is the code for executing a proc that takes in a varray of varchar_pair_object (s):
Copy paste this code in TOAD's sql editor and change it to adapt to your function and types and hit F9. TOAD will ask you the type of the :to_grid variable. Select cursor (assuming your function returns a ref cursor) and hit enter. TOAD will bind the result set to a data grid.
Links that helped me:
http://www.smart-soft.co.uk/Oracle/oracle-plsql-tutorial-part-11.htm (good tutorial on collections)
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/10_objs.htm#1972 (especially useful in this case is the section on declaring and initializing objects)
With very little change the same can be done with a procedure.