I am currently experimenting with Oracle's XMLTYPE and just wanted to check with more competent monks that I am doing it right (it's the first time I have ever looked at it).
This is my table-definition:
CREATE TABLE abba (id NUMBER, xml XMLTYPE)
To insert xml into this table I do the follwing:
my $xml = "<hubba><bubba></bubba></hubba>"; my $sth = $dbh->prepare(<<sqlend); insert into abba values (1, :xml) sqlend $sth->bind_param(":xml", $xml, { ora_type => ORA_XMLTYPE } ); $sth->execute;
To extract xml I do the following:
my $sth = $dbh->prepare(<<sqlend); select id, xmltype.getclobval(xml) xml from abba where id = 1 sqlend $sth->execute;
So far this seems to work - is that the way to do it?
Are there any pitfalls I should be aware of?
Will this still work with larger xmls? Many thanks!
Oh and by the way we have Oracle 10.2.
In reply to DBD::Oracle and XMLTYPE by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |