简体   繁体   English

将表中的列值作为参数传递给存储过程sql

[英]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.

相关问题 从另一个过程调用时将参数值传递给存储过程 - passing parameter values to stored procedure when calling from another procedure 将表名和列名动态传递给 PL/SQL 存储过程 - Passing table name and column name dynamically to PL/SQL Stored procedure Crystal Report从“类似” SQL传递存储过程参数 - Crystal Report Passing Stored Procedure Parameter from “Like” Sql SQL:如何执行存储过程,该存储过程在column为“ IN”参数的情况下返回值? - SQL: How to execute stored procedure that returns values where column is “IN” parameter? PL/SQL 存储过程用于更新由参数指定的列的值 - PL/SQL stored procedure to update values of a column that is specified by the parameter SQL:使用表的列值作为存储过程的参数 - Sql: using table's column value as a parameter for the stored procedure 如何从表(SQL Server数据库)中将值选择为参数(存储过程)? - How to select values from a table (SQL Server database) into a parameter (Stored Procedure)? 将列名作为参数传递给 mySQL 中的存储过程 - Passing a column name as parameter to a stored procedure in mySQL 将值列表和表的参数传递给存储过程 - passing parameter of list of values and tables to stored procedure 将列表代替sql参数传递给存储过程 - Passing a list in place of sql parameter to a stored procedure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM