|
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
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.