Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load BLOB into DB2 1

Status
Not open for further replies.

akp123

Programmer
Jan 19, 2007
3
US
Hi
I am trying to load a flat file containing BLOBs into DB2 V8 on iSeries V5R3.
Is there a way I can use CPYFRMIMPF to get the data loaded?
Please advice.
I am new to iSeries and DB2. Any help is much appreciated.
 
How is the matching BLOB column defined in the DB2 file ?
 
Hi
Thanks a lot for your response...

The matching column in DB2 is also a BLOB.
I ran the following sql to create the table I am trying to populate as:
CREATE TABLE PROGC(
COMXYZABCD_ID FOR COLUMN I_COM00001 INTEGER NOT NULL ,
FA_ID VARCHAR(4) CCSID 37 NOT NULL ,
COMXYZABCD_DATA FOR COLUMN BL_CO00001 BLOB(1048576) DEFAULT NULL ,
USER_ID VARCHAR(20) CCSID 37 DEFAULT NULL ,
D_ADD TIMESTAMP DEFAULT NULL ) ;

The data file contains records in the following format:
1^|AB|^|XYZ.001.0.475/|^|1234ID|^|2004-10-18-11.48.50.295000|

The XYZ.001 file referenced by the blob XYZ.001.0.475 contains the actual xml values.

When I ran the CPYFRMIMPF i got the following warning message:
"the selected table contains LOB columns, which require use of secondary stream files.These files contain actual LOB data for import. The corresponding columns of data file contain name and path of the secondary stream file.The import operation will otherwise. See CPYFRMIMPF command for more help".

And the load fails.

Any help on this is much appreciated.

 
I guess that the flat file is in the IFS (Integrated File System) since you're using CPYFRMIMPF.

Are you sure that the file columns are BLOBs and not GRAPHICS instead ?
 
Thanks Mercury2 for the post.
Yes. The flat file is on IFS.
We are using BLOBs since we receive xml data in the BLOBS.
Also doing some research I found out that we cannot use CPYFRMIMPF command to import files containing BLOBS.
Db2 load and import utilities seem to be other options.
I am currently looking how I can make use of either one to load data.
Have you used them before please advice..
 
Also IMHO I think that you cannot straightforwardly use CPYFRMIMPF to import a file containing blobs.

I've never used Db2 load nor import utilities. This pertains to another domain as mine, ie iSeries and DB2 UDB for iSeries. Not able to help you in that way, apologies.
 
I've asked Cozzi's RPGIV.com and got this :

"You'd have to read the blob [from the IFS] into a program in its entirety, and then move it to the BLOB field. You would need to use embedded SQL to assign the value to the blob field."

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top