Page 1 of 1

XMLType Fields

Posted: Thu 24 Apr 2008 08:46
by gad
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

Posted: Fri 25 Apr 2008 07:52
by Plash
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).

Posted: Fri 25 Apr 2008 10:55
by gad
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

Posted: Sat 26 Apr 2008 06:29
by Plash
This is the Oracle SQL syntax. You should use an alias if you call a method for an object type field.