On Thu, 9 Feb 2023 18:01:24 + Sri h Kolusu wrote:
:>>>2. How can I specify the SQLSTATE so that NOT FOUND will be the condition?
I am writing the SP itself in COBOL and want to return an SQLCODE.
:>Assuming that you are calling the Stored procedure from COBOL, here is an
example of how the
:>Sent: Thursday, February 9, 2023 12:03
:>To: IBM-MAIN@LISTSERV.UA.EDU
:>Subject: New DB2 external Stored Procedure question - setting
:>sqlcode/sqlstate
:>
:>I am trying to return a NOT FOUND condition, so I am setting the SQLSTATE
:>parameter to '02000'
:>
:>
>>2. How can I specify the SQLSTATE so that NOT FOUND will be the condition?
Binyamin Dissen,
Assuming that you are calling the Stored procedure from COBOL, here is an
example of how the SQLCODES are handled.
https://www.ibm.com/docs/en/db2-for-zos/12?topic=examples-example-cobol-program-that-c
: Thursday, February 9, 2023 12:03
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: New DB2 external Stored Procedure question - setting
sqlcode/sqlstate
I am trying to return a NOT FOUND condition, so I am setting the SQLSTATE
parameter to '02000'
However, the calling program is getting
DSNT408I SQLC
I am trying to return a NOT FOUND condition, so I am setting the SQLSTATE
parameter to '02000'
However, the calling program is getting
DSNT408I SQLCODE = -443, ERROR: ROUTINE SP01 (SPECIFIC NAME SP01) HAS
RETURNED
AN ERROR SQLSTATE WITH DIAGNOSTIC TEXT DSNT418I SQLSTATE = 02000
SQLSTA