I am brand new to coding with DBI and am trying to set up a simple
prepare/execute/fetch routine. I'm receiving the following error on my
prepare statement line: "Can't call method "prepare" on an undefined
value at ./test.cgi line 51."
Here's is my sub:
sub db_statement
{
my $sth = $dbh->prepare("select rollup_code, rollup_value, french_flag
from FMC_REPORT_CREATE_PARAMS
where aggr_rpt_id = 2
order by report_seq_num");
$sth->execute;
while ( @row = $sth->fetchrow_array ) {
print "@row\n";
}
}
Can anyone tell me what I'm doing wrong with the prepare statment? Thanks!
Deb Vredeveld