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 > inserting image to my table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-10, 11:34
wavio wavio is offline
Registered User
 
Join Date: Feb 2010
Posts: 3
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
Reply With Quote
  #2 (permalink)  
Old 02-03-10, 11:37
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
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.1.0.2 os 5.3.0.0
Reply With Quote
  #3 (permalink)  
Old 02-03-10, 11:53
wavio wavio is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 02-03-10, 12:47
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
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.1.0.2 os 5.3.0.0
Reply With Quote
  #5 (permalink)  
Old 02-03-10, 13:16
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Another option is to use the IMPORT command - check out the LOBS FROM option.
Reply With Quote
  #6 (permalink)  
Old 02-05-10, 10:16
wavio wavio is offline
Registered User
 
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?
Reply With Quote
  #7 (permalink)  
Old 02-05-10, 11:24
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #8 (permalink)  
Old 02-05-10, 11:59
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
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.
Reply With Quote
  #9 (permalink)  
Old 02-08-10, 06:12
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
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