Resultset_from_proc command

SQL*XL
home

Syntax:
resultset_from_proc(procedure_call);

procedure_call is the call to the procedure that needs to be executed including the parameters and return parameter. As return parameter a ? should be used as placeholder. This is the position where the procedure should output its ref cursor.

Extra parameters can be passed by hard coding them into the call, for example:
select * from resultset_from_proc('myproc(1,2,?)');

Substitution variables (variables marked with a & such as &myvariable) can also be used to pass extra parameters to the procedure as is shown in the following example:
select * from resultset_from_proc('myproc(&A1, &A2, ?);

Description:
Switches statement timing on or off. After the execution of a statement it will display the execution time in a dialog box.

Examples:
select * from resultset_from_proc('mypackage.my_proc(?)');
select * from resultset_from_proc('mypackage.my_proc(1,2,3,?)');
select * from resultset_from_proc('mypackage.my_proc(1,2,?)');
select * from resultset_from_proc('mypackage.my_proc(&A1, &A2, ?);

Another Example:
select * from recordset_from_proc("empanddept.getempdata(?)");

Package:

CREATE OR REPLACE PACKAGE EmpAndDept
AS
   cursor emp is select * from emp;
   TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE; 
   PROCEDURE GetEmpData (emp_cv OUT EmpCurTyp) ;
END EmpAndDept;
/
CREATE OR REPLACE PACKAGE BODY EmpAndDept
AS
   PROCEDURE GetEmpData (emp_cv OUT EmpCurTyp)
   IS
   BEGIN
      OPEN emp_cv
      FOR SELECT * FROM emp;
   END GetEmpData;
END EmpAndDept;
/


See also: