Hi All,
When I call an external stored procedure I want to set the SQL state and
error text when an error occurs. Currently my program is setting the SQL
state correctly but it is cutting off the error text.
CALL RROGERSON1/GETSALES('A')
SQL State: 38I99
Vendor Code: -443
Message: [SQL0443] SPR0055: An unexpecte
I can't see why the text is being cut off. Any suggestions?
This is the code for my SP
CREATE OR REPLACE PROCEDURE RROGERSON1/GETSALES (
IN LISTTYPE VARCHAR(1) )
DYNAMIC RESULT SETS 1
LANGUAGE RPGLE
SPECIFIC RROGERSON1/SPR0055
NOT DETERMINISTIC
READS SQL DATA
CALLED ON NULL INPUT
EXTERNAL NAME 'RROGERSON1/SPR0055 '
PARAMETER STYLE SQL ;
And this the code to the external program.
Hoption(*nodebugio:*srcstmt)
D SPR0055 pr
D pr_ListType 1a varying const
D pr_ListType_ni...
D 5i 0 const
* Define the parameters required to throw an SQL Error
d pr_SQL_State 5a
d pr_SQL_Function...
d 517a const varying options(*varSize)
d pr_SQL_Spec...
d 128a const varying options(*varSize)
d pr_SQL_Msg 70a varying options(*varSize)
D SPR0055 pi
D pr_ListType 1a varying const
D pr_ListType_ni...
D 5i 0 const
* Define the parameters required to throw an SQL Error
d pr_SQL_State 5a
d pr_SQL_Function...
d 517a const varying options(*varSize)
d pr_SQL_Spec...
d 128a const varying options(*varSize)
d pr_SQL_Msg 70a varying options(*varSize)
*
D psDs sds
D PROGNAME *PROC
D jobid 244 269
/free
pr_SQL_State = '38I99';
pr_SQL_Msg = %Trim(PROGNAME) +
': An unexpected Program error occurred.';
*inlr = *on;
/end-free
Thanks all,
Robert Rogerson
As an Amazon Associate we earn from qualifying purchases.