如何将对列表传递给Oracle存储过程?
问题描述:
我想编写一个Oracle PL/SQL存储过程,它将一些其他类型的对的列表作为参数,如varchar2(32)
。这可能吗?什么是最好的方式来做到这一点?如何将对列表传递给Oracle存储过程?
答
这听起来像你只是想在集合中传递,即
SQL> create type point as object (
2 x_coordinate number,
3 y_coordinate number);
4/
Type created.
SQL> create type point_array
2 is
3 table of point;
4/
Type created.
SQL> create procedure interpolate(points IN point_array)
2 as
3 begin
4 null;
5 end;
6/
Procedure created.
SQL> declare
2 points point_array := point_array(point(0,1), point(1,1));
3 begin
4 interpolate(points);
5 end;
6/
PL/SQL procedure successfully completed.
显然,在现实中,函数会做与传递的数组的东西,但这是一般的想法。
你想如何调用这个存储过程?从Java,从.net,从SQL或PL/SQL? – TTT 2010-10-18 18:45:39