It is an RPG issue, not SQL
The error IS the RNF0269
So, since you can declare a field to be 32K in length and even as a variable length, how do you fill it?
I even created a physical file with a 32000 length field (with VARYING keyword)and declared it as an external data structure, but still get the RNF0269 trying to fill it. It seems there is no way around splitting the statement into pieces and concatenating it all back together...
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Thursday, May 12, 2016 2:32 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: SQL Statement length
On 12-May-2016 15:45 -0500, Graves, Chuck wrote:
On Thursday, May 12, 2016 4:03 PM Graves, Chuck wrote:
Is there a "trick" to programming a long complex (6000 character) SQL
statement in RPG?
We keep getting a "variable truncated" error message.
<<SNIP>> The error is on the compile. <<SNIP>>
Seems likely the error is not with a variable, but with a /literal/ specification [being assigned to a variable], and thus one of:
* QRG4173 30 Literal length exceeds maximum and is truncated at
maximum.
* RNF0269 20 Character literal is too long; literal truncated.
One likely resolution is to define the statement as static instead of assigning the value to a variable.
Another might be to concatenate multiple literals; i.e. instead of just one assignment such as
stmt='one very long literal';
use multiple statements with shorter literals:
stmt='one';stmt+=' very';stmt+=' long';stmt+=' literal';
Or as dlclark mentioned
[
http://archive.midrange.com/rpg400-l/201605/msg00130.html], be sure that a statement that has been /beautified/ on successive lines does not include all of the white-space; i.e. choose the line-continuation that maintains a valid statement while excluding any extraneous blanks.
--
Regards, Chuck
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (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.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
[Rodda Paint Company]
Chuck Graves
Director of Information Systems
Rodda Paint Co.<
http://www.roddapaint.com>
6107 N. Marine Drive
Portland, Oregon 97203
(503) 737-6042
As an Amazon Associate we earn from qualifying purchases.