Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL Package not returning SQLCODE for not found
PL/SQL Package not returning SQLCODE for not found [message #39236] Fri, 28 June 2002 11:54 Go to next message
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 #39260 is a reply to message #39236] Mon, 01 July 2002 11:56 Go to previous messageGo to next message
Dhiren
Messages: 43
Registered: July 2002
Member
Are you using a null indicator variable - in that case you should be checking for 0, 1, -1 in your code.
Is your code throwing out some other exception?.
What happens if you run just the package on its own.
Need these details to figure out.
Re: PL/SQL Package not returning SQLCODE for not found [message #39262 is a reply to message #39260] Mon, 01 July 2002 14:28 Go to previous message
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;
Previous Topic: DISTINCT CLAUSE
Next Topic: URGENT: ORA-04091 table name is mutating, trigger/function may not see it
Goto Forum:
  


Current Time: Thu Apr 25 11:30:11 CDT 2024