I'm using DBI 1.21 and DBD 1.12 with an oracle9i database backend.
Here is my problem, I have a table named 'test' with three fields: eid
(integer), x (SYS.XMLTYPE) and formname (text)
I create a database handler and connect to the database just fine.
I create a new statement handler with the following command:
$sth = $dbh->prepare("INSERT INTO test (eid, x, formname) VALUES (?,
SYS.XMLTYPE.CREATEXML(?), ?");
I loop over some data, $eid gets and integer, $xmlvalue gets a string,
and $formname gets a string. So long as $xmlvalue is relatively short
$sth->execute($eid, $xmlvalue, $formname); works great, but as soon as
it becomes long enough to force the use of clob's I have a problem.
So I tried the following:
$sth->bind_param(1, $i);
$sth->bind_param(2, $xmlvalue, { ora_type => ORA_CLOB });
$sth->bind_param(3, $intable);
$sth->execute;
This works great if column 'x' is a normal CLOB and I omit the
sys.xmltype.createxml statement above, but when 'x' is of type
sys.xmltype I get the following error:
nvalid LOB locator specified
ORA-06512: at "SYS.XMLTYPE", line 0
Right now I've hacked the setup so there is a supplemental table called
'y' of type CLOB that I submit to, then I do $dbh->do("UPDATE test SET x
= SYS.XMLTYPE.CREATEXML(y)");, which works but doesn't seem like the
right way to do this.
Is there any way to do what I want in the current version of
DBI/OracleDBD?
--
Mark Stillwell
[EMAIL PROTECTED]
http://plaza.ufl.edu/marklee/