如何使用参数“table of foo”执行 SP?
使用 sqlplus 如何执行具有“table of foo”参数的存储过程?
例如,在下面的包中,我如何执行 'Get_AnnotationsForEmp' ?
create or replace PACKAGE "PKG_DROM" as
TYPE tblCostCentreIdentifier IS TABLE OF BLA_COST_CENTRE.CCE_IDENTIFIER%TYPE INDEX BY BINARY_INTEGER;
TYPE tblCCEAutoID IS TABLE OF BLA_COST_CENTRE.CCE_AUTOID%TYPE INDEX BY BINARY_INTEGER;
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PROCEDURE Get_AnnotationsForEmp(
EMP_EMPLOYEE_ID_IN IN BLA_EMPLOYEE.EMP_EMPLOYEE_ID%TYPE,
CCE_IDENTIFIER_OUT OUT tblCostCentreIdentifier,
CCE_AUTOID_OUT OUT tblCCEAutoID);
PROCEDURE Get_PastAnnotationsForEmp(
EMP_EMPLOYEE_ID_IN IN BLA_EMPLOYEE.EMP_EMPLOYEE_ID%TYPE,
CCE_IDENTIFIER_OUT OUT tblCostCentreIdentifier,
CCE_AUTOID_OUT OUT tblCCEAutoID);
END PKG_DROM;
如果该过程位于包“BAR”中并且看起来像这样……
PROCEDURE FOO (ID IN NUMBER);
那么我知道我可以像这样执行它:
declare
r number;
begin
r := BAR.FOO (1);
end;
但是我如何扩展这个想法以适应“表”的 OUT 参数?
Using sqlplus how can I execute a stored procedure which has arguments which are 'table of foo' ?
So for instance in the following package how can I execute 'Get_AnnotationsForEmp' ?
create or replace PACKAGE "PKG_DROM" as
TYPE tblCostCentreIdentifier IS TABLE OF BLA_COST_CENTRE.CCE_IDENTIFIER%TYPE INDEX BY BINARY_INTEGER;
TYPE tblCCEAutoID IS TABLE OF BLA_COST_CENTRE.CCE_AUTOID%TYPE INDEX BY BINARY_INTEGER;
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PROCEDURE Get_AnnotationsForEmp(
EMP_EMPLOYEE_ID_IN IN BLA_EMPLOYEE.EMP_EMPLOYEE_ID%TYPE,
CCE_IDENTIFIER_OUT OUT tblCostCentreIdentifier,
CCE_AUTOID_OUT OUT tblCCEAutoID);
PROCEDURE Get_PastAnnotationsForEmp(
EMP_EMPLOYEE_ID_IN IN BLA_EMPLOYEE.EMP_EMPLOYEE_ID%TYPE,
CCE_IDENTIFIER_OUT OUT tblCostCentreIdentifier,
CCE_AUTOID_OUT OUT tblCCEAutoID);
END PKG_DROM;
If the procedure was in a package 'BAR' and looked like this ...
PROCEDURE FOO (ID IN NUMBER);
... then I know I could execute it like this :
declare
r number;
begin
r := BAR.FOO (1);
end;
but how can I extend that idea to accomomdate the OUT arguments which are 'table of' ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过使用 package.type 语法声明变量:
By declaring the variables using the package.type syntax: