On Fri, Jan 30, 2004 at 11:41:31AM +0100, Hendrik Fuss wrote:
> Hi everyone,
> 
> It's been a while since I last posted here. In September 2003 I was
> trying to add support for binding XMLType objects to DBD-Oracle, so that
> you could easily insert large (ie >4k) XML data into an XMLType table.
> 
> Unfortunately my employer fired me in October 2003 and in the remaining
> time I had to work on other projects, so I wasn't able to complete the
> DBD project. Since I won't have access to an oracle database from now
> on, I thought the least I can do is to provide my code as it is to the
> list. Blame German economy. :-(

I'm sorry to hear that Hendrik.

> The attached patch (based on DBD-Oracle 1.15) enables you to upload
> XMLType objects (OCIXMLTypePtr) by binding them as SQLT_NTY. In dbdimp.c
> I added a function dbd_rebind_ph_nty for that purpose. You need to
> create that XMLType object first using the C function
> createxmlfromstring in xml.c.

I there any chance you could post that as a context diff (diff -u ideally
or else diff -c)? It's much safer and more useful. Thanks.

>   my $xml = createxml($dbh, '<test>Test document</test>');
>   my $sth = $dbh->prepare('INSERT INTO xml_type VALUES (?)');
>   $sth->bind_param(1, $xml, { ora_type => 108 }); # SQLT_NTY
>   $sth->execute();

Great.

> Please note that this code is really just early development, which I
> wouldn't publish under normal circumstances. :) I just hope it might me
> useful to someone.

It will. I'll add it in and let others polish it :)

> Well then, time to say goodbye
> thanks to Tim and everyone who contributed to dbi for a great piece of
> software

Thanks Hendrik. And thank you for your contribution. Many people
have asked for named type support. It's great to be able to get
such a good kick start with the code.

Good luck.

Tim.

Reply via email to