declare
x staff_olam.security_cursor;
begin
staff_olam.staff_security_fetch('ethan',x);
dbms_output.put_line(x);
end;
/
the x is a cursor with 4 records in it and I am getting this error.
declare
*
ERROR at line 1:
ORA-06550: line 5, column 1:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored
how to I print the contents of the cursor to the screen?
DBMS_OUTPUT.PUT_LINE doesn't accept a variable of type CURSOR - that's why you got the eror message. You have to pass to this procedure the result of the fetching (a number, varchar or date...), not the cursor itself.
numbers are fine. Don't use boolean, and clearly you can't use any user defined types (including cursors). There's no way Oracle would know how to output that data. You'll have to do that one field at a time through your procedure.
---------------------
kris109 DBMS_OUTPUT.PUT_LINE is limited that way:
You can not display any datatype other than CHAR, VARCHAR2. All other datatypes need conversion or you will get an error.
-------------------------
DBMS_OUTPUT.PUT_LINE will display data, number , char and varchar2 without any converions. It is a overloaded function.
Bookmarks