If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Db2 Blob

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-05, 11:52
tunatoo tunatoo is offline
Registered User
 
Join Date: Oct 2005
Posts: 15
Db2 Blob

I want to test saving an image file (currently a PDF at the UNIX AIX level) as a BLOB in a DB2 record. I've created a field with the correct specifications to handle it, but I have no idea what command to use to Insert a row containing this image in a field. Is there a way, or do I have to take another approach? Thanks!
Reply With Quote
  #2 (permalink)  
Old 10-12-05, 12:39
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
blob

you can use import command
instead of column value, specify file name and location
import from xx.xx of del modified by lobsinfile....
if needing todo update on existing row there are some samples in ibm devlopers work how to handle lob from java
http://www-128.ibm.com/developerwork...310bhogal.html
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #3 (permalink)  
Old 10-12-05, 15:09
tunatoo tunatoo is offline
Registered User
 
Join Date: Oct 2005
Posts: 15
Thanks - the article was good, except for now I'm trying to do it outside Java, using straight SQL from the DB2 => prompt into a New record.

The Unix path of the image LOB file is /usr/appdata/TestImaging.pdf

The table has two other fields (Number (small integer) and Description (text))

insert into IMAGING values ("12345","/usr/appdata/TestImaging.pdf","Test Record") - fails.

I know I'm missing something here.
Reply With Quote
  #4 (permalink)  
Old 10-13-05, 11:39
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
blob

you can not use insert
you should have a pointer to the storage where the pdf is residing in memory
and doing insert
I will check if I can find some samples
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On