TSmartQuery : Handle XMLTYPE Column like CLOB Column

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

TSmartQuery : Handle XMLTYPE Column like CLOB Column

Post by jfudickar » Wed 12 Sep 2007 21:37

Hi ,

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

Greetings and thanks
Jens

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 13 Sep 2007 08:42

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.

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Thu 13 Sep 2007 11:01

Did you have a sample for the insert / update statements.

The table could look like:

create table xml_test (data xmltype);

Greetings
Jens

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 13 Sep 2007 12:22

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.)

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Fri 14 Sep 2007 10:38

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 14 Sep 2007 15:16

We'll consider possibility to implement handling XMLTYPE using CLOB.

Post Reply