Lin Feng wrote:
> Have Oracle's SQLX function such as XMLAGG(), XMLELEMENT() been
> impletemented in DBD::Oracle? I got an error (OCIDefinedObject call
> needed but not implemented yet]. This is on Oracle 9.2.


Those functions do not need to be implemented in DBD::Oracle, since they're
executed by the server.

What isn't implemented is returning the XMLType object type; so just fetch
the generated XML as a CLOB or VARCHAR2.

For example:

sqlx.pl:
#!perl -w
use strict;
use DBI;

my $dbh = DBI->connect('dbi:Oracle:', 'test/[EMAIL PROTECTED]',
         '',
         {
   AutoCommit  => 0,
   LongTruncOk => 0,
   LongReadLen => 65535,
   RaiseError  => 1,
         }) or die DBI->errstr;

print $dbh->selectrow_array(q{
select XMLElement(foo, 'bar').getClobVal()
from   dual
});

$dbh->disconnect;


__END__

$ ./sqlx.pl
<FOO>bar</FOO>

-- 
Andy Hassall ([EMAIL PROTECTED]) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)

Reply via email to