Pure Oracle::OCI - attach to server
Load the module and initialise the OCI and its Environment handle:
use Oracle::OCI qw(:all);
OCIInitialize(OCI_OBJECT | OCI_THREADED | OCI_EVENTS | OCI_SHARED, 0, 0, 0, 0);
my $envhp = new_ptr('OCIEnvPtr'); #
OCIEnvInit($envhp, OCI_DEFAULT, 0, 0);
Allocate Error and Server handles:
OCIHandleAlloc($$envhp, my $errhp=0, OCI_HTYPE_ERROR, 0, 0);
$errhp = new_ptr('OCIErrorPtr', $errhp); #
OCIHandleAlloc($$envhp, my $svrhp=0, OCI_HTYPE_SERVER, 0, 0);
$svrhp = new_ptr('OCIServerPtr', $svrhp); #
OCIServerAttach($svrhp, $errhp, 0, 0, OCI_DEFAULT);