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 > Issue in inserting into a blob datatype column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-06-04, 03:54
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
Issue in inserting into a blob datatype column

Hi all,

I am using DB2 8.1 version. I get this following error when I try to insert value into blob datatype column.

INSERT INTO eventalertfilter VALUES ('[B@16ab2e8')

Please explain this.

Thanks,
Sam
Reply With Quote
  #2 (permalink)  
Old 05-06-04, 08:02
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Lightbulb Which error ??

I think you copied wrong ,-)
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #3 (permalink)  
Old 05-06-04, 08:26
SamCute SamCute is offline
Registered User
 
Join Date: Mar 2004
Posts: 205
What you mean by 'copied wrong' ?

I found the solution :

insert into test values(blob('fgfg'))

blob function should be given , if the column is of blob datatype.

I think I am right. If not please specify. Also if anyother solution is available kindly suggest.

Thanks,
Sam
Reply With Quote
  #4 (permalink)  
Old 05-06-04, 08:40
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Smile

I mean that I can't see that you specified any error message:

But yes you have to state the BLOB function if you are inserting
a string like above - to let db2 know that 'blahblab' should be
treated as a binary object (casting it - if you like)

If you are inserting a (binary) file:

insert into mytable values ('/pathonserver/myclobfile.extension')

Should do the trick.

HTH
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #5 (permalink)  
Old 05-06-04, 09:44
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Red face Wait

Forget the last two sentences.

I only tested it on CLOB and it did insert the string.

But it did not insert the file - does anyone know how to take
the ascii content of a file on the same server an inserting it
into the CLOB clumn ?

Cheers
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
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