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



The file will be loaded by the Fetch operation.

You wouldn't expect the value of your "audfid" field to be loaded before you actually fetched into it would you?
The same will be true for the blob.
You are giving the Blob a name prior to executing the fetch.
Then, when the fetch occurs the system should load the data into the blob.


So setting the name before the fetch will do you no good, as the AUDFID field will probably not be loaded with any meaningful data yet.


I suggest you select into a generically named blob, then rename after the fetch, and see if that solves the issue.


Dcl-Pr unlink Int(10) ExtProc('unlink');
path Pointer Value options(*string);
End-Pr;

BLOB_NAME = '/IASP/PublicAS400/Images/tempblobname';

// remove the file before you start so you cleanup from any prior load.
Unlink(blob_name);


Then rename the blob after you have "Fetched" the record

Dcl-Pr rename Int(10) ExtProc('Qp0lRenameKeep');
old Pointer Value options(*string);
new Pointer Value options(*string);
End-Pr;

Dow...;

Fetch into :blob :audfid;

Newname = '/IASP/PublicAS400/Images/images/' + %trim(audfid) + '.jpg'

Rename( blob_name : newName );

Enddo;


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Art Tostaine, Jr.
Sent: Tuesday, May 17, 2022 11:19 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Extracting all BLOB's from table

I'm able to get one BLOB correct by doing EXEC SQL SELECT, but whenever I
do a cursor to get multiple images for an ID, it doesn't write the BLOB.
When is SQL supposed to create the IFS file? After the FETCH NEXT?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.