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



http://www.mcpressonline.com/rpg/techtip-blobs-don-t-run-embrace-them-with-rpg.html

Using RPG to Extract Binary Files from BLOB Columns

So now the binary data is safely tucked away in the BLOB. What happens in
the future when you need to access the data in the BLOB? You simply write
the file back out of the IFS. Just use the appropriate file options to
instruct the program to go the other direction. The following RPG example
does just that.

*D MYFILE S SQLTYPE(BLOB_FILE) *

*D SQL_FILE_OVERWRITE... *

*D c const(16) *

*/free *

* myfile_fo = SQL_FILE_OVERWRITE; *

* myfile_name = '/home/2011_Data/Financials_2011.xls'; *

* myfile_nl = %len(%trimr(myfile_name)); *

* exec SQL *

* SELECT docblob *

* INTO :myfile *

* FROM QGPL/DOCREPOS *

* WHERE DocTitle = '2011 Financials Spreadsheet'; *

* return; *

*/end-free *

*
*


On Wed, Mar 13, 2013 at 10:56 AM, <rob@xxxxxxxxx> wrote:

Ok, you have BLOB columns, character columns, numeric columns, etc. What
is another type? Datalink? Now, I've never used them, but is there some
way to move a blob column to a data link column?


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Jack Prucha <Jack.Prucha@xxxxxxx>
To: "MIDRANGE-L@xxxxxxxxxxxx" <MIDRANGE-L@xxxxxxxxxxxx>,
Date: 03/13/2013 10:51 AM
Subject: Move SQL Blob field (PDF) to IFS folder - How?
Sent by: midrange-l-bounces@xxxxxxxxxxxx



Am writing an external stored procedure (rpgle) to read a bunch of db2 sql
tables populated by a web process. Part of what the procedure is being
asked to do is move a pdf, which is stored as a blob in one of the tables,
onto a folder so it can be processed by Content Manager (our imaging
system). The Content Manager guys claim they cannot read the blob or do
anything with it (the api wants a folder). The web guys (Java & WAS) can
and have dropped all sorts of objects on the IFS, but prefer that the
stored procedure does it in this application.

I've searched this list and the internet in general and don't know where
to begin. There's little Java application code running on the iSeries so
a Java solution would be a maintenance issue. I'd appreciate any help.

TIA.

Jack






This email, including any documents, files, or previous email messages
attached to it, has been sent from an email account of College Foundation
Inc., (CFI) and may contain confidential, proprietary, or legally
privileged information belonging to CFI. If you are not the intended
recipient, any dissemination, distribution, or copying of this email or
its attachments is strictly prohibited. If you have received this email
in error, please immediately notify the sender by email and destroy the
original email and any attachments.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



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.