What are tags?
How to bind an Oracle RAW to perl-variable within a select
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Perl web-programming > How to bind an Oracle RAW to perl-variable within a select 11 December 2003 19:24:53

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

How to bind an Oracle RAW to perl-variable within a select

Verbrugghen Johan 11 December 2003 19:24:53
 Hi,

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("inse­rt 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("SELE­CT 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;


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Perl web-programming > How to bind an Oracle RAW to perl-variable within a select 11 December 2003 19:24:53

see also:
How long?
Any add-on software for searching by…
Search Engines To Avoid
пройди тесты:
see also:
My heart.....
Memories......
Times......

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .