× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.