-
I have the following code:
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?
-
You will have to cycle through your cursor and use dbms_output.put_line for each record in your cursor.
Jeff Hunter
-
Hi lesstjm,
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.
Regards,
-
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.
-
DBMS_OUTPUT.PUT_LINE is limited that way:
You can not display any datatype other than CHAR, VARCHAR2, NUMBER AND DATE. All other datatypes you will get an error.
Moreover, you can not display BOOLEAN datatypes or CURSORS as in this case.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|