Hi. I've only just joined the [email protected] list and happened to
notice this thread in the archives.

It seems that what you're trying to do is similar to something I added
to DBD::Oracle back when I was working on the Oracle::OCI module.
http://search.cpan.org/~timb/Oracle-OCI-0.06/MANIFEST

The Oracle::OCI module provides an (auto-generated) perl extension
giving full access to the vast Oracle OCI API. It used a typemap file
http://cpansearch.perl.org/src/TIMB/Oracle-OCI-0.06/extra.typemap
and the T_PTROBJ typemap to expose the many OCI types:

    T_PTROBJ
        $var = ora_getptr_${ntype}(...)

plus a header file to map them back to a C function for handling:
http://cpansearch.perl.org/src/TIMB/Oracle-OCI-0.06/getptrdef.h

See ora_getptr_generic() and especially get_oci_handle() in:
http://cpansearch.perl.org/src/TIMB/Oracle-OCI-0.06/utility.c

The get_oci_handle() function is accessing the internals of
the DBD::Oracle handle C structure. To make this possible
DBD::Oracle installs the relevant .h file.

The results is that you can pass $dbh and $sth directly to Oracle::OCI
functions and Oracle::OCI will automatically extract the relevant info
from the handle. Sweet.

I always feel a little sad about Oracle::OCI. It was, and still is, a
great concept, but I moved on from Oracle years ago and it's not seen
much love since. (Not helped by being auto-generated so the distro
seems 'empty'. It doesn't appear on metacpan.org at all.)

Anyway, there might be some useful ideas/methods in there for you.

Tim.

Reply via email to