Results 1 to 4 of 4

Thread: Db2 Blob

  1. #1
    Join Date
    Oct 2005
    Posts
    15

    Unanswered: 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!

  2. #2
    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

  3. #3
    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.

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •