Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2005
    Posts
    24

    Unanswered: How to store the images in db2 as BLOB ?????

    Hi,

    May I know how to store and retrieve the images in the database as BLOB data type unless using extender?
    Can we store like that unless using extender?



    Thanks,

  2. #2
    Join Date
    Jun 2006
    Posts
    471

    blob

    there have been some recent discussion regarding this subject
    do a search and have a look
    this is one of the entries:
    http://www.dbforums.com/showthread.php?t=1198711
    Last edited by guyprzytula; 12-14-06 at 03:23.
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Aug 2005
    Posts
    24
    Hi guyprzytula,

    I have been read the article BLOB for Java.But what I would like to know is that whether we can insert and select the BLOB data types or not and if can,how to do that?
    I am not using Java or Unix.
    I am working on the window environment.


    Thanks,


    Quote Originally Posted by guyprzytula
    there have been some recent discussion regarding this subject
    do a search and have a look
    this is one of the entries:
    http://www.dbforums.com/showthread.php?t=1198711

  4. #4
    Join Date
    Jun 2006
    Posts
    471

    blob

    as indicated before, the only way without a program is using import and keeping the blobs in a file
    with import replace the column contents with the location/name of the blob file
    do import with : modified by lobsinfile
    retrieve is not possible : blob is not displayable
    select with extenders or application
    see develop.works for some articles on how to handle blob data from within an appl
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  5. #5
    Join Date
    Aug 2005
    Posts
    24
    Hi guyprzytula,

    Thanks for your response.
    I have another 2 questions.
    1.May I know how to write the sql script?I am not very clear the following setense.What I am confusing is if I store the path,it's like storing a link.But I don't think you mean like it.Could u pls give me more explanation or give the script sample?

    2.Can I retrieve it(BLOB pict) using other applications like Microsoft.Net???

    Thanks in advance,


    using import and keeping the blobs in a file
    with import replace the column contents with the location/name of the blob file
    do import with : modified by lobsinfile


    Quote Originally Posted by guyprzytula
    as indicated before, the only way without a program is
    using import and keeping the blobs in a file
    with import replace the column contents with the location/name of the blob file
    do import with : modified by lobsinfile
    retrieve is not possible : blob is not displayable
    select with extenders or application
    see develop.works for some articles on how to handle blob data from within an appl

  6. #6
    Join Date
    Jun 2006
    Posts
    471

    blob

    table : col1 char(1), col2 integer, col3 blob
    create an file keeping the input data
    sample input.data
    a,1,c:\data\picture1.jpg
    b,2,c:\data\picture2.jpg
    now execute import
    import from input.data of del modified by lobsinfile insert into tablename
    q2: have a look at develop.work - there should be some samples-docs...
    or have a look in appl develop guide of db2
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  7. #7
    Join Date
    Aug 2005
    Posts
    24
    Dear guyprzytula,

    If I store like c:\data\picture1.jpg,how the database store(as path or as image? I mean the database will store the path as "c:\data\picture1.jpg" or will store the actual image?
    After I store the image as "c:\data\picture1.jpg",can I delete the physical picture(picture1.jpg)? I mean ,if there is no such path(c:\data\picture1.jpg) in the PC,can I retrieve the image?

    Thanks in advance,



    Quote Originally Posted by guyprzytula
    table : col1 char(1), col2 integer, col3 blob
    create an file keeping the input data
    sample input.data
    a,1,c:\data\picture1.jpg
    b,2,c:\data\picture2.jpg
    now execute import
    import from input.data of del modified by lobsinfile insert into tablename
    q2: have a look at develop.work - there should be some samples-docs...
    or have a look in appl develop guide of db2

  8. #8
    Join Date
    Jun 2006
    Posts
    471

    lob

    yes the entire file will be stored. If needed, the physical file can be removed.
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  9. #9
    Join Date
    Aug 2005
    Posts
    24
    Thank you so much,guyprzytula.
    Btw,if I store the image in the database,the database size would be about 2 times bigger than before.Am I right?

    May I know what is the advantages and disadvatages of storing the CLOB,BLOB data in the database?

    Thank in advance,



    Quote Originally Posted by guyprzytula
    yes the entire file will be stored. If needed, the physical file can be removed.
    Last edited by Coolhard; 01-15-07 at 02:07.

Posting Permissions

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