Re: Oracle XMLTYPE column truncates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roberto Mansfield wrote:
Mikey wrote:
Roberto Mansfield wrote:
Hi Mikey,

OCI doesn't directly support the XMLtype so you need to convert to
string (if < 4k) or clob before retrieving. Use:

select xml_metadata.getClobVal() ... OR
select xml_metadata.getStringVal() ...

If converting to clob, you get a clob object back and you'll need to run
the load() method on it to get the text back.

Roberto
Hi Roberto, thanks for your reply - any pointers to resources for
dealing with CLOBS?

Mikey

Checkout
http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_lobs.html

and go to the section "Selecting a LOB".

-Roberto

LOL - thanks a lot Roberto ;o)

Two caveats that I just found the hard way...

1). In the documentation they alias the table - IGNORE THIS AT YOUR PERIL! It will not recognise getClobVal() unless you do.

2). Bit of a silly one, but I guess someone else might make the same mistake... when you add the alias and the getClobVal() call, you change the name of the column returned. So $row['xml_metadata'] won't exist unless you alias the column back ot that name. Doh!

Mikey

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux