I am using perl 5.8.0, and DBI 1.32, and Oracle DBD 1.12.
I was asked to insert some data into a table that looks like this:
SQL> describe PROTEIN
Name Null? Type
----------------------------------------- --------
----------------------------
PROTEINENTRYID VARCHAR2(32)
XMLDATA XMLTYPE
If I insert short pieces of XML (< 4k), it works, but for longer entries,
I get an error:
ORA-01461: can bind a LONG value only for insert into a LONG column (DBD
ERROR: OCIStmtExecute)
I see no mention of XMLDATA in the DBD code, where it has other types you
can use as the type parameter for bind, so you can't do something like:
$sth->bind_param(2, $xmlvalue, { ora_type => ORA_CLOB });
but using something like ORA_XMLDATA instead of ORA_CLOB.
There was a message in the archives about this type of problem:
http:[EMAIL PROTECTED]/msg11123.html
where someone came up with a workaround of inserting into a column of a
temporary table of type CLOB, then doing an UPDATE to the real
table/column from the CLOB column, using something like:
$dbh->do("UPDATE test SET x = SYS.XMLTYPE.CREATEXML(y)");
but, that was a while back, and I wondered if anyone had come up with any
modifications to the DBD, or other workarounds for inserting long XMLTYPE
data.
This appears to be due to the Oracle DBD not supporting this new data
type.
Thanks,
Susan