can you post the rest of the code. have you  connected properly and
initialized your objects
> 
> 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";
>        }
> }
>

Reply via email to