Thanks, I'll have to play with that one.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

------------------------------

message: 2
date: Mon, 12 Jan 2026 19:47:31 +0100
from: "Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>
subject: RE: Using QSYS2.HTTP_GET_BLOB to download file larger than
16mb with SQL

If you want to write the information into the IFS, there is no need to save it first in a LOB Variable or LOB Locator.
It can be directly written into a LOB-File:

Here is an example of writing a source physical file member into the IFS:
DCL-S MyBLOBData SQLType (BLOB_File);

DCL-S ParToIFSFile VarChar(256) Inz('/home/Hauser/SavSource.txt');
DCL-S ParFromMbr VarChar(256) Inz('HSRRRPG/QEMBSRC(EMBLOBFIL2)');

//**************************************************************************
*******************
Exec SQL Set Option Commit=*CHG, DatFmt=*ISO, TimFmt=*ISO,
Naming=*SYS, CloSQLCsr=*EndActGrp;
//Copy Source File Into IFS
MyBLOBData_Name = %Trim(ParToIFSFile);
MyBLOBData_NL = %Len(MyBlobData_Name);
MyBLOBData_FO = SQFOVR; //Replace if
exists

Exec SQL Set :MyBlobData = Get_Blob_From_File(:ParFromMbr);
If SQLCODE < *Zeros;
//Error handling
EndIf;

Exec SQL commit;

*InLR = *On;


Mit freundlichen Gr??en / Best regards

Birgitta Hauser
Modernization ? Education ? Consulting on IBM i Database and Software Architect IBM Champion since 2020

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"
"Train people well enough so they can leave, treat them well enough so they don't want to. " (Richard Branson) "Learning is experience ? everything else is only information!" (Albert
Einstein)


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Richard Schoen
Sent: Monday, 12 January 2026 19:22
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Using QSYS2.HTTP_GET_BLOB to download file larger than 16mb with SQL

In my scenario I was writing to the IFS.

Would love to a write it to DB example.

Regards,
Richard Schoen
Web:?http://www.richardschoen.net
Email:?richard@xxxxxxxxxxxxxxxxx

----------------------------------------------------------------------

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2026 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.