db2 :insert xml clolumn failed, HELP!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • db2lu
    New Member
    • Apr 2010
    • 1

    db2 :insert xml clolumn failed, HELP!

    created a table like, CREATE TABLE m(c1 INT , c2 XML INLINE LENGTH 1000)
    but insert to xml column failed,

    db2 => insert into m values (' ', "xmlparse(docum ent '<?xml version=\"1.0\" encoding=\"utf-8\" ?> <book> </book>' preserve whitespace)")
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0007N The character "\" following "'<?xml version=\"1.0" is not valid.
    SQLSTATE=42601



    could you tell me what's wrong there? thx!
  • Amarnath Reddy N
    New Member
    • May 2010
    • 11

    #2
    I modified your Insert statement to work properly.

    try below db2 command :

    db2 "insert into m values (1, xmlparse(docume nt '<?xml version=\"1.0\" encoding=\"utf-8\" ?> <book> </book>' preserve whitespace))"

    DB20000I The SQL command completed successfully.

    Comment

    Working...