Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> EXEC syntax for SP which returns row set
I have a package and stored procedure as follows:
create or replace package TEST.ReturnCur is
-- REF CURSOR type for returning result sets from procedures
TYPE REF_CUR IS REF CURSOR;
END ReturnCur;
CREATE or replace PROCEDURE TEST.SPTEST
(C1 OUT ReturnCur.REF_CUR)
AS
BEGIN
open C1 for SELECT ID from TEST.EMPLOYEE;
END;
How do I test this procedure from SQL*Plus.
When I use: exec sec.test2
I get the following error message:
BEGIN sec.test2; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'TEST2' ORA-06550: line 1, column 7:
When I use: exec sec.test2()
I get the following error message:
BEGIN sec.test2(); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'TEST2' ORA-06550: line 1, column 7:
When I use [ID is char(8)]: exec sec.test2('12345678')
I get:
BEGIN sec.test2('12345678'); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'TEST2' ORA-06550: line 1, column 17: PLS-00363: expression '12345678' cannot be used as an assignment target ORA-06550: line 1, column 7: