|
Hi Orlando
When i want to ensure the size of any variable before using in sql
statements, first of all declare the variable and it's features:
create variable VARIABLE clob(1G);
My Select statements.......;
drop variable VARIABLE;
Regards.
------------------------------char(900).
message: 6
date: Tue, 18 Sep 2018 22:52:45 -0500
from: orlando misas <omisas@xxxxxxxxx>
subject: Error handing field CLOB
Hi,
I have a file with 38000 records, the record has only one field
I need to join these fields in a single field type CLOB (1G). The filesize
exceeds 30 megabytes . I use the following instruction:CLOB
SELECT CAST ( LISTAGG ( CAST ( TRIM ( FIELD ) AS CLOB ( 1 K ) ) ) AS
( 1 G ) )<ARInvoiceDataSet><InvcDtl><Company>81</Company><InvoiceNum>10771</InvoiceNum><InvoiceLine>1</InvoiceLine><PartNum>E12720-60-999</PartNum>.........
INTO VARIABLE
FROM LIBRARY.FILE ;
Where VARIABLE is CLOB ( 1 G)
When I execute this sentence, I obtain an error, because the result is
greater than one mega then I change the instruction by:
SELECT GET_CLOB_FROM_FILE ( 'LIBRARY/FILE(MEMBER)' , 0 )
INTO VARIABLE
FROM SYSIBM . SYSDUMMY1
WITH CHG ;
This instruction run ok, but the content of the variable is incomplete
because it cuts information from the records that it unites.
Example:
-First records of the file:
<ARInvoiceDataSet>
<InvcDtl>
<Company>81</Company>
<InvoiceNum>10771</InvoiceNum>
<InvoiceLine>1</InvoiceLine>
<PartNum>E12720-60-999</PartNum>
.....
.....
- Expected string:
Dtl><Company>81</Company><InvoiceNum>10771</InvoiceNum><InvoiceLine>1</InvoiceLine><PartNum>E12720-60-</PartN>....
- Obtained string:
--
This process is in iSeries V7.3 in a store procedure sql pure.
Does anybody have an idea?
Thank you.
Orlando Misas
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
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.