XMLType Fields

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
gad
Posts: 3
Joined: Thu 10 Jan 2008 14:29

XMLType Fields

Post by gad » Thu 24 Apr 2008 08:46

Hi,

I have to work with xmlType fields.
Is there a possibility to handle them for select, insert and update in queries? The type doesn't seem to be supported directly (Unknown data type (116) (d:\Projects\Delphi\Dbx\Source\dbexp.pas, line 2131) :(
If yes, a sample would be great

thanks and best regards

gad

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

Post by Plash » Fri 25 Apr 2008 07:52

DbxOda does not support XMLTYPE fileds. But you can work with them using CLOB. For example:

SELECT t.xml_col.getclobval() FROM xml_table t

You can insert a value to XMLTYPE field using string parameter:

INSERT INTO xml_table (id, xml_col) VALUES (1, XMLTYPE(:p))

Set the DataType property of the P parameter to ftString. You also need to set the Size property of the parameter to a value that is large enough (the maximum size of string parameter is about 30000).

gad
Posts: 3
Joined: Thu 10 Jan 2008 14:29

Post by gad » Fri 25 Apr 2008 10:55

Hi,

Thanks a lot for your really quick answering.

It works!
:D
I tried the select without the alias before. It never worked. Why do I have to use the alias? Is it wise to always base on aliases with DbxOda?

Best Regards and thanks

gad

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

Post by Plash » Sat 26 Apr 2008 06:29

This is the Oracle SQL syntax. You should use an alias if you call a method for an object type field.

Post Reply