PL/SQL Package not returning SQLCODE for not found [message #39236] |
Fri, 28 June 2002 11:54 |
Shane
Messages: 27 Registered: December 1999
|
Junior Member |
|
|
I am calling a package from a COBOL program. The package opens a cursor and selects a row.
I used to get the ORA-01405 error when I would normaly get not found. I corrected that by using null indicator, but now I'm not getting the usual row not found whenI get back to the cobol program.
Is there something I can do?
|
|
|
|
Re: PL/SQL Package not returning SQLCODE for not found [message #39262 is a reply to message #39260] |
Mon, 01 July 2002 14:28 |
Shane
Messages: 27 Registered: December 1999
|
Junior Member |
|
|
Yes, I am using the null indicators.
This is old code being moved from another system. It used to be embeded SQL, but I'm looking into moving to stored procedures. Currently the COBOL code is looking for +100 in SQLCODE to determine when it is time to stop processing, but for some reason PLSQL does not set SQLCODE = +100 when it gets a not found. I'm not sure, but this may just be with a cursor.
create or replace package body T257 is
-- Private variable declarations
CURSOR CURS_J838F9A (NYSIISCD IN CHARACTER ) IS
SELECT MPI_NBR FROM MPI_PERSON_NS WHERE
NYSIIS_CD = nysiiscd;
-- Procedure implementations
PROCEDURE nysiis(NYSIISCD IN CHARACTER,
MPINBR OUT DECIMAL) IS
BEGIN
IF NOT CURS_J838F9A%ISOPEN THEN -- open the cursor if not already open
OPEN CURS_J838F9A(nysiiscd);
END IF;
FETCH CURS_J838F9A INTO mpinbr; -- fetch a row from the cursor
END;
END T257;
|
|
|