Page 1 of 1

TSmartQuery : Handle XMLTYPE Column like CLOB Column

Posted: Wed 12 Sep 2007 21:37
by jfudickar
Hi ,

is there a way to handle a XMLTYPE Column like an CLOB Column, so that it could be edited.

Greetings and thanks
Jens

Posted: Thu 13 Sep 2007 08:42
by Plash
You can use the CLOB_VAL method of XMLTYPE in your SELECT statement. But you need to assign to the SQLInsert and SQLUpdate properties statements that write a value of a CLOB field to the database.

Posted: Thu 13 Sep 2007 11:01
by jfudickar
Did you have a sample for the insert / update statements.

The table could look like:

create table xml_test (data xmltype);

Greetings
Jens

Posted: Thu 13 Sep 2007 12:22
by Plash
INSERT INTO xml_test(id, data) VALUES(:id, XMLTYPE(:data))

UPDATE xml_test SET id = :id, data = XMLTYPE(:data)
WHERE id = :old_id

(You need to add ID field to the table for UPDATE statement.)

Posted: Fri 14 Sep 2007 10:38
by jfudickar
Thanks,

but why isn't it possible to handle the xmltype like a clob column.

In the allroundautomations components there is no problem with the xmltype columns.

Greetings
Jens

Posted: Fri 14 Sep 2007 15:16
by Plash
We'll consider possibility to implement handling XMLTYPE using CLOB.