× 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.



I am testing an SQL SP that will pass a CLOB CCSID 37 to an RPGLE program.

No matter what I try in formatting the SQL call within iNav, the CLOB variable has no data (as shown by iNav's debugger). The CLOB contains XML, so the parser throws an error (351, reason 302) that indicates that the needed '<' is missing. And the LEN portion of the variable is updated to the correct length of the XML.

I've tried both of these variations of the call with no luck:

call sjneedl.sngetquote('1234567','', 'OR','', '1000000000',
'<itemlist>
<item><itemid>1111111</itemid><quantity>1</quantity><altitem>0</altitem><carrierservicelevel></carrierservicelevel></item>
<item><itemid>2222222</itemid><quantity>1</quantity><altitem>0</altitem><carrierservicelevel></carrierservicelevel></item>
</itemlist>');

And

call sjneedl.sngetquote('1234567','', 'OR','', '1000000000',
cast('<itemlist>
<item><itemid>1111111</itemid><quantity>1</quantity><altitem>0</altitem><carrierservicelevel></carrierservicelevel></item>
<item><itemid>2222222</itemid><quantity>1</quantity><altitem>0</altitem><carrierservicelevel></carrierservicelevel></item>
</itemlist>' as clob(2m)));

This is the message I see:

Message ID . . . . . . : RNX0351 Severity . . . . . . . : 50
Message type . . . . . : Escape
Date sent . . . . . . : 06/08/17 Time sent . . . . . . : 11:58:11

Message . . . . : The XML parser detected error code 302.
Cause . . . . . : While parsing an XML document for an RPG procedure, the
parser detected an error at offset 0 with reason code 302. The actual
document is *N; *N indicates that the XML document was not an external file.
Recovery . . . : Contact the person responsible for program maintenance to
determine the cause of the problem.

changing from a CLOB to a VARCHAR(30000) gets some of the data into the program, but I need all of the CLOB, not just the first 30,000 bytes.


CREATE or replace PROCEDURE SJNEEDL.SNGETQUOTE (
IN PARM1 CHAR(12) ,
IN PARM2 CHAR(6) ,
IN PARM4 CHAR(2) ,
IN PARM4 CHAR(3) ,
IN PARM5 CHAR(10) ,
IN PARMCLOB
--CLOB(2097152) or
varchar(30000)
ccsid 37 )
.
.
.
IF SUBSTR ( PARM5 , 1 , 1 ) = '1' THEN CALL SJNEEDL . SN641R ( PARM1 , PARM2 , PARM4 , PARM4 , PARM5 , PARM6, PARMCLOB ) ; END IF ;
.
.
.


RPG defns

D sn641R pr ExtPgm( 'SN641R' )
D #PARM1_...
D Like( #PARM1 )
D #PARM2_...
D Like( #PARM2 )
D #PARM3_...
D Like( #PARM3 )
D #PARM4_...
D Like( #PARM4 )
D #PARM5_...
D Like( #PARM5 )
D #PARM6_...
D Like( #PARM6 )
d #PARMCLOB_ like( CLOB_2M )

D SN641R pi
D #PARM1...
D 12a
D #PARM2...
D 6a
D #PARM3...
D 2a
D #PARM4...
D 3a
D #PARM5...
D 10a
D #PARM6...
D 1a
d #PARMCLOB like( CLOB_2M )
.
.
.
d CLOB_2M s SQLtype(CLOB:2097152)



Steve Needles



CONFIDENTIAL: The information contained in this email communication is confidential information intended only for the use of the addressee. Unauthorized use, disclosure or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us immediately by return email and destroy all copies of this communication, including all attachments.

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.