Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't Get the Cursor Back from Pkg
Message
 
 
To
All
General information
Forum:
Oracle
Category:
Packages
Title:
Can't Get the Cursor Back from Pkg
Miscellaneous
Thread ID:
00593830
Message ID:
00593830
Views:
158
Now that I have created the package, nothing I try will actually return the cursor from the package. After creating my connection to Oracle, my SQLExec syntax is:

lnresult = sqlexec(lnHandle, lcSQL, "crsPermit")

where lcSQL is defined on each of the SQL Cmd lines below. Each of the 5 variations of the Call SQL produced the following errors:
*** Test 1 ***
SQL Cmd: {call GetPermits.ReturnCursor('LA0006335');}
Error #: 1526
Msg 1  : Connectivity error: [Microsoft][ODBC driver for
         Oracle]Syntax error or access violation
Msg 2  : [Microsoft][ODBC driver for Oracle]Syntax error or
         access violation
Msg 3  : 37000

*** Test 2 ***
SQL Cmd: {call GetPermits.ReturnCursor('LA0006335')};
Error #: 1526
Msg 1  : Connectivity error: [Microsoft][ODBC driver for
         Oracle][Oracle]ORA-06550: line 1, column 48:
         PLS-00103: Encountered the symbol ";" The symbol ";"
         was ignored.
Msg 2  : [Microsoft][ODBC driver for Oracle][Oracle]
         ORA-06550: line 1, column 48:PLS-00103: 
         Encountered the symbol ";" The symbol ";"
         was ignored.
Msg 3  : 37000

*** Test 3 ***
SQL Cmd: {call GetPermits.ReturnCursor('LA0006335')}
Error #: 1526
Msg 1  : Connectivity error: [Microsoft][ODBC driver for
         Oracle][Oracle]ORA-06550: line 1, column 7:
         PLS-00306: wrong number or types of arguments in
         call to 'RETURNCURSOR'
         ORA-06550: line 1, column 7:PL/SQL: Statement ignored
Msg 2  : [Microsoft][ODBC driver for Oracle][Oracle]ORA-06550:
         line 1, column 7:PLS-00306: wrong number or types
         of arguments in call to 'RETURNCURSOR'ORA-06550:
         line 1, column 7:PL/SQL: Statement ignored 
Msg 3  : 37000

*** Test 4 ***
SQL Cmd: call GetPermits.ReturnCursor('LA0006335');
Error #: 1526
Msg 1  : Connectivity error: [Microsoft][ODBC driver for
         Oracle][Oracle]ORA-00911: invalid character
Msg 2  : [Microsoft][ODBC driver for Oracle][Oracle]ORA-00911:
         invalid character
Msg 3  : 37000

*** Test 5 ***
SQL Cmd: call GetPermits.ReturnCursor('LA0006335')
Error #: 1526
Msg 1  : Connectivity error: [Microsoft][ODBC driver for
         Oracle][Oracle]ORA-06553: PLS-306: wrong number or
         types of arguments in call to 'RETURNCURSOR'
Msg 2  : [Microsoft][ODBC driver for Oracle][Oracle]ORA-06553:
         PLS-306: wrong number or types of arguments in call to
         'RETURNCURSOR'
Msg 3  : NA000
No matter what my syntax is, an error is returned.Since the cursor is defined in the package appears as the first parameter, would this be why I get the error? This should not be that difficult. TIA!

As a convenience, the code used to create the package is below:
CREATE OR REPLACE PACKAGE GetPermits AS
 Type RetCursor Is Ref Cursor;
 Procedure ReturnCursor(pCursor OUT RetCursor, c_pmt IN char);
END;
/
show error
CREATE OR REPLACE PACKAGE BODY GetPermits AS
 Procedure ReturnCursor(pCursor OUT RetCursor, c_pmt IN char) is
 Begin
  open pCursor for select * from npdes.permits where permit_num = c_pmt;
 End;
END;
/
show error
Mark McCasland
Midlothian, TX USA
Next
Reply
Map
View

Click here to load this message in the networking platform