在过程中调用过程

时间:2012-01-26 13:37:51

标签: stored-procedures plsql oracle9i

我有一个包内的程序结构:

PROCEDURE proc_All
(
   start IN date := null,
   end IN date := null,
   cursor1 OUT sys_refcursor,
   cursor1 OUT sys_refcursor,
   cursor1 OUT sys_refcursor
);

PROCEDURE proc_1
(
   start1 IN date := null,
   end1 IN date := null,
   cursor1_1 OUT sys_refcursor,

);   
PROCEDURE proc_3
(
   start2 IN date := null,
   end2 IN date := null,
   cursor1_2 OUT sys_refcursor,

);  
PROCEDURE proc_3
(
   start3 IN date := null,
   end3 IN date := null,
   cursor1_3 OUT sys_refcursor,

); 

现在我的要求是我想要第一个过程proc_All来调用所有三个下一个过程,因为我希望proc_All被程序调用。如何在调用其他过程(天气为IN或OUT类型)时将变量传递给过程

任何人都可以提前帮助.. thanx

1 个答案:

答案 0 :(得分:2)

这应该有用(虽然我不确定你是否可以使用关键字“end”作为参数名称):

PROCEDURE proc_All
(
   start IN date := null,
   end IN date := null,
   cursor1 OUT sys_refcursor,
   cursor1 OUT sys_refcursor,
   cursor1 OUT sys_refcursor
)
IS
BEGIN

  proc_1
  (
     start1 => start,
     end1 => end,
     cursor1_1 => cursor1
  );   

  proc_2
  (
     start2 => start,
     end2 => end,
     cursor1_2 => cursor2
  );   

  proc_3
  (
     start3 => start,
     end3 => end,
     cursor1_3 => cursor3
  );   

END;