J
Jeff
I'm having issues with selectall_hashref. Here's my code:
===================
#!/usr/bin/perl
use DBI;
use Data:umper;
$ENV{'TDSPORT'}="1433";
# Set Login Information
$Server="xxxx.xxx.xxx";
$User="xxxxx";
$Pass="xxxxxx";
# Connect to database
$dbh=DBI->connect("dbi:Sybase:server=$Server",$User,$Pass) || die
"$DBI::errstr\n";
# Read from database
$SQL="
SELECT
CallID,PlannedDate,PlannedTime,Solution,Status,DevApprov,qaApprvl,whoApprvdDev,whoApprvdQA
FROM heat.Detail WHERE PlannedDate = '2004-10-06'
";
$Results = $dbh->selectall_hashref("$SQL","CallID");
# Disconnect from database
$dbh->disconnect;
__END__
Here's what Data:umper shows . . .
$VAR1 = {
'00492613' => {
'CallID' => '00492613',
'PlannedTime' => ' ',
'Status' => '1 - Pending',
'PlannedDate' => '2004-10-06',
'DevApprov' => 'F',
'Solution' => 'test lead notification',
'whoApprvdQA' => ' ',
'qaApprvl' => 'F',
'whoApprvdDev' => ' '
},
};
=====================
Question one: Where is the $VAR1 variable coming from?
Question two: What happened to $Results?
Question three: How do I reference the data (ie, in a print
statement)?
Thanks.
===================
#!/usr/bin/perl
use DBI;
use Data:umper;
$ENV{'TDSPORT'}="1433";
# Set Login Information
$Server="xxxx.xxx.xxx";
$User="xxxxx";
$Pass="xxxxxx";
# Connect to database
$dbh=DBI->connect("dbi:Sybase:server=$Server",$User,$Pass) || die
"$DBI::errstr\n";
# Read from database
$SQL="
SELECT
CallID,PlannedDate,PlannedTime,Solution,Status,DevApprov,qaApprvl,whoApprvdDev,whoApprvdQA
FROM heat.Detail WHERE PlannedDate = '2004-10-06'
";
$Results = $dbh->selectall_hashref("$SQL","CallID");
# Disconnect from database
$dbh->disconnect;
__END__
Here's what Data:umper shows . . .
$VAR1 = {
'00492613' => {
'CallID' => '00492613',
'PlannedTime' => ' ',
'Status' => '1 - Pending',
'PlannedDate' => '2004-10-06',
'DevApprov' => 'F',
'Solution' => 'test lead notification',
'whoApprvdQA' => ' ',
'qaApprvl' => 'F',
'whoApprvdDev' => ' '
},
};
=====================
Question one: Where is the $VAR1 variable coming from?
Question two: What happened to $Results?
Question three: How do I reference the data (ie, in a print
statement)?
Thanks.