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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
[EMAIL PROTECTED]
com To: [EMAIL PROTECTED]
cc: (bcc: Sachin Raje/HRA/COP/HONDA)
02/25/02 Subject: SELECT \$moid FROM xyz.abc
12:36 PM
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.
**********************************************************************
**********************************************************************
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.
**********************************************************************