Results 1 to 6 of 6

Thread: insert document

  1. #1
    Join Date
    Dec 2003
    Posts
    4

    Unanswered: 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...

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: insert document

    What is the column defn ?

    Word docs have to go into BLOB and not CLOB

    Cheers
    sathyaram

    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.

  3. #3
    Join Date
    Dec 2003
    Posts
    4
    it is a varchar area....

  4. #4
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Originally posted by dileck
    it is a varchar area....
    Try a VARCHAR with the clause FOR BIT DATA.
    --
    Jonathan Petruk
    DB2 Database Consultant

  5. #5
    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.

  6. #6
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    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

Posting Permissions

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