kamesh3183 has asked for the wisdom of the Perl Monks concerning the following question:
when I execute this script its not returning any data while i query the database through SQL*Plus it is returning data. So i think there must be some problem while converting hex to raw. please help me..use strict; use DBI; my $domain_id; my $dbh = DBI->connect("dbi:Oracle:host=$dbhost;sid=$dbname;port=15 +21", "$dbuser/$dbpass", "") or die "unable to connect: $DBI::errstr\n +"; my $statement = qq|select domain_id from networks_full where netnumbe +r = hextoraw(?)|; #netnumber is raw type. my $sth = $dbh->prepare($statement) or die "Couldn't prepare statement +: $DBI::errstr; stopped"; my $hexnetnumber = '3E198000'; $sth->execute($hexnetnumber) or die "Couldn't execute statement: $DBI: +:errstr; stopped"; while(my $ref = $sth->fetchrow_hashref()) { $domain_id = $ref->{'domain_id'}; } $sth->finish; print "domain_id is:",$domain_id,"\n"; $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with oracle hextoraw function
by virtualsue (Vicar) on Apr 23, 2005 at 12:59 UTC |