Hi,

I'm launching this question on the developer-list,
since it seems to be closer to the actual porting of the DBD::Oracle than
to the generic use of the DBI.
(I've posted this to the dbi-users-list without much of a success...)
Anyway here it is:

After many attempts I'm failing to make the DBD::Oracle driver to bind an
output variable of a select of a RAW database field to a perl-variable,
*without* the implicit conversion of the field value to its HEX-format.
For non-select statements it works smoothly to bind perl-variables to this
type of fields.

All help is strongly appreciated.

Thx,

Johan

-----------------------------------------------------------------------------------------------------------------------------
ENV:
DBI 1.32 - DBD::Oracle 1.12 - HPUX11.11 - Oracle 9.2

TABLE:
create table rawtab (col raw(2000))

TEST-script:
#!perl -w
use DBI;
$dbh = DBI->connect( "DBI:Oracle:" , "","", {PrintError => 1, AutoCommit
=> 1})
  or die $DBI::errstr . "\n";
my ($sth, $raw);
# cleanup first
$dbh->do("truncate table rawtab") or die $DBI::errstr . "\n";
#put a record
$sth = $dbh->prepare("insert into rawtab values (?)\n") or die $DBI::errstr
. "\n";
$raw='H';
$sth->bind_param(1, $raw , { ora_type => 23 });
$sth->execute;
#get it back
$sth = $dbh->prepare("SELECT col INTO :col from rawtab\n") or die $DBI::errstr
. "\n";
$sth->bind_col(1, \$raw , { ora_type => 23 });
$sth->execute;
$sth->fetch;
print "raw: $raw\n";                       # <-- here the H should come
again, but we get the HEX-string 48
$sth->finish;
$dbh->disconnect;
exit;


Reply via email to