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 > insert document

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-04, 07:25
dileck dileck is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
insert document

hi all,
I am trying to insert a word document into database. A java class reads the file and writes the contents to database. I dont have problem with txt,html or java documents but when I try to insert word or excel document I get an error message


[IBM][CLI Driver][DB2/6000] SQL0010N The string constant beginning with "' Ï à¡± á" does not have an ending string delimiter. SQLSTATE=42603


I have no escape character in my word or excel document, and I use a function to correct " ' " character...do you know how to solve this...
Reply With Quote
  #2 (permalink)  
Old 04-16-04, 07:40
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: insert document

What is the column defn ?

Word docs have to go into BLOB and not CLOB

Cheers
sathyaram

Quote:
Originally posted by dileck
hi all,
I am trying to insert a word document into database. A java class reads the file and writes the contents to database. I dont have problem with txt,html or java documents but when I try to insert word or excel document I get an error message


[IBM][CLI Driver][DB2/6000] SQL0010N The string constant beginning with "' Ï à¡± á" does not have an ending string delimiter. SQLSTATE=42603


I have no escape character in my word or excel document, and I use a function to correct " ' " character...do you know how to solve this...
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 04-16-04, 08:07
dileck dileck is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
it is a varchar area....
Reply With Quote
  #4 (permalink)  
Old 04-16-04, 08:43
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally posted by dileck
it is a varchar area....
Try a VARCHAR with the clause FOR BIT DATA.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #5 (permalink)  
Old 04-16-04, 08:54
dileck dileck is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
in fact I couldnt understand well why it does matter? because I read the content of the file with a java function and it returns a string, and I insert this string..so how can it understand that it is from a word doc.
Reply With Quote
  #6 (permalink)  
Old 04-16-04, 09:01
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally posted by dileck
in fact I couldnt understand well why it does matter? because I read the content of the file with a java function and it returns a string, and I insert this string..so how can it understand that it is from a word doc.
Maybe I don't quite understand your question.

Java may be able to represent the binary stream from the Word file as funky chracters in Unicode or some such thing, but if the database is not defined as Unicode there's no mapping to a character db2 knows.

You also have to be careful storing character data as BIT DATA for the same reason - if you insert it from a Unicode environment then read it from something else, you will get bit-for-bit what you put in, which may not appear as real characters in the second environment.
__________________
--
Jonathan Petruk
DB2 Database Consultant
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