Hello,
Still need help.....
So far the discussions have revolved around getting the $moid to be passed
on to DB2.
I think this is already being done because I do get a list.
The problem is that the list is all SQL_BINARY data since &char is being
stored in that column.
The question is : How do I DEREF the address?
Sorry ! Maybe I was not being clear in my original question.
$moid is the name of the column in the database. It is not being set to
some value in my program.
>>>>>snip>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..
#!/usr/bin/perl -w
use DBI;
my ($dbh, $sth, @rows);
open (WRT_FH , ">/tmp/lst.txt") || die "Cannot create list file: $!";
$dbh = DBI->connect( "dbi:DB2:VPMDB" , "User" , "passwd" , {
PrintError => 0,
RaiseError => 1
} ) ;
$sth = $dbh->prepare( 'SELECT $moid FROM catenv.cattabl');
$sth->execute();
while (@rows = $sth->fetchrow() ){
foreach (@rows){
print WRT_FH "$_\t";
}
print WRT_FH "\n";
}
$dbh->disconnect();
close(WRT_FH);
exit;
>>>>>snip>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
Hello,
Using DBI for DB2.
The column $moid has &char(8) stored
When I use command line and connect to the database and type: db2 SELECT
\$moid FROM xyz.abc
I get the required results eg: 40199EAFXXX
When i use DBI-> connect and then try "SELECT \$moid FROM xyz.abc"
I get the binary data stored in that column.
How can I get the referenced data.
Thanks
Sachin
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************