[英]Passing column values from a table as parameter to a stored procedure sql
I have a stored procedure that accepts two values. 我有一个接受两个值的存储过程。 The stored procedure looks like this
SP_Test(ID1,ID2)
. 存储过程如下所示:
SP_Test(ID1,ID2)
。
I have an Oracle table T1 which has two columns ID1 and ID2. 我有一个Oracle表T1,其中有两列ID1和ID2。 I want to read each row from this table and pass parameters(ID1 and ID2) to the stored procedure SP_Test.
我想从该表中读取每一行,并将参数(ID1和ID2)传递给存储过程SP_Test。
How can I achieve this? 我该如何实现?
Thanks Anusha 谢谢阿努莎
In a loop? 循环吗?
begin
for cur_r in (select id1, id2 from t1) loop
sp_test (cur_r.id1, cur_r.id2);
end loop;
end;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.