Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2010
    Posts
    3

    Unanswered: inserting image to my table

    hi, i'm trying to load image to my table which consist of 2 column,
    ImageID (varchar) and Image(Blob)
    i'm trying to insert it through the DB2 control center but i found no way to do so.
    what should i do in order to do the image insertion to the table?by the control center or query statement?

    thx before

  2. #2
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    db/os version?

    code you are running?

    SQL error you are getting?

    Other wise I think you forgot to press that thingy on the left
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  3. #3
    Join Date
    Feb 2010
    Posts
    3
    Quote Originally Posted by Cougar8000 View Post
    db/os version?

    code you are running?

    SQL error you are getting?

    Other wise I think you forgot to press that thingy on the left
    i'm using db2 9.7 in my windows xp

    i was trying to add row, i managed to insert the imageID column as it is a varchar but i found no way to insert the image column that comes in blob data type
    is there any way to insert the blob column with open table or query statement?
    the image file is located in my desktop directory

  4. #4
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    Look into /sqllib/samples/java/jdbc>more DtLob.java

    there are samples there. plus google has many hits on "insert image into db2"
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Another option is to use the IMPORT command - check out the LOBS FROM option.
    ---
    "It does not work" is not a valid problem statement.

  6. #6
    Join Date
    Feb 2010
    Posts
    3
    Quote Originally Posted by n_i View Post
    Another option is to use the IMPORT command - check out the LOBS FROM option.
    could you show me steps to do it?


    anyway, i hope if there is anyway to do query than makin java program to store the picture?

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    n_i and cougar8000 have given you hints ...
    Anything more, probably you need to hire someone

    Quote Originally Posted by wavio View Post
    could you show me steps to do it?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  8. #8
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by wavio View Post
    could you show me steps to do it?
    Certainly.

    1. Open DB2 Information Centre at DB2 Database for Linux, UNIX, and Windows

    2. Search for "import command".

    3. Read.

    4. ???

    5. Profit.
    ---
    "It does not work" is not a valid problem statement.

  9. #9
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You can also read here. I UDF (user-defined function) is shown to import files residing on the database server machine: A DB2 UDB still image extender
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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