Debugging a stored procedure with cursor in Sqlplus

Source: Internet
Author: User
Tags reference sqlplus
Stored procedure stored procedure create or replace package pkg_test as
Type t_cursor is REF CURSOR;
Procedure Sp_get_catalogs (P_userid in number, cur_catalogs out t_cursor);
End Create or replace package body pkg_test as
Procedure Sp_get_catalogs (P_userid in number, cur_catalogs out t_cursor) is
V_sql VARCHAR2 (500);
Begin
If P_userid = 0 Then
Open Cur_catalogs for
Select UserID, loginID, name from Tuser;
Else
V_sql: = ' Select Userid,loginid,name from Tuser where Userid=:w_userid ';
Open Cur_catalogs for V_sql
Using P_userid;
End If;
exception
When others then
Dbms_output.put_line (' other exception ');
End Sp_get_catalogs;
End Pkg_test; Sqlplus Debug code variable v_cur refcursor;
Variable V_userid number;
Set Autoprint off;
Begin
: V_userid: =-9222229;
End
/
Execute pkg_test.sp_get_catalogs (: V_userid,: V_cur);
Print V_cur summary pl/sql Developer in command Window input (sqlplus debug code) debug stored procedure appears "Refcursor don ' t supported!" Error, change to sqlplus inside debugging all normal. Reference documentation Sql*plus User ' s Guide and Reference release 9.2






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.