Re: New DB2 external Stored Procedure question - setting sqlcode/sqlstate

2023-02-09 Thread Binyamin Dissen
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

Re: New DB2 external Stored Procedure question - setting sqlcode/sqlstate

2023-02-09 Thread Binyamin Dissen
:>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' :> :>

Re: New DB2 external Stored Procedure question - setting sqlcode/sqlstate

2023-02-09 Thread Sri h Kolusu
>>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

Re: New DB2 external Stored Procedure question - setting sqlcode/sqlstate

2023-02-09 Thread Lance D. Jackson
: 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

New DB2 external Stored Procedure question - setting sqlcode/sqlstate

2023-02-09 Thread Binyamin Dissen
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