sql - 在PLSQL中的另一个存储过程中使用存储过程的值

标签 sql oracle plsql

有没有办法从另一个存储过程调用一个存储过程,并在第一个存储过程中使用检索到的值(从第二个过程)?

最佳答案

-- procedure #1
create or replace procedure Proc1(p_RetValue out SomeDataType) 
is
begin
  -- any logic goes here
  p_retValue := 5+5; -- for example. Let's assume that the SomeDataType is number;   
end;

-- second procedure 
create or replace procedure Proc2 is
  l_variable number;
begin
  Proc1(l_variable);  -- the value 10 will be assigned to l_variable;
end; 

关于sql - 在PLSQL中的另一个存储过程中使用存储过程的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12403273/

相关文章:

mysql - 非常简单的 MySQL SELECT 语句导致错误

php - MySQL 嵌套查询 : returning single row and multiple row queries from two tables

oracle - 导出为插入语句 : But in SQL Plus the line overrides 2500 characters!

oracle - PLSQL Collections - 如何使用记录表?

sql - 将日期时间值四舍五入到最接近的半小时

sql - 如何使用 xPath (10g) 在 Oracle SQL extract() 中获取节点名称

sql - 如何并行化一个简单的 SELECT 查询?

plsql - 寻找重复的源代码

mysql - Oracle 中 REF 数据类型的使用

SQL - 计数 WHERE AGGREGATE>1