Are you sure you were connected to the database? Please check if $dbh is
defined.

Bao

[EMAIL PROTECTED] wrote:

> 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

--
BAO RuiXian,  PROGRAMMER, Technologies Team, Project Services Group
AtBusiness Communications Corp., Kaapeliaukio 1, FIN-00180 Helsinki
tel. +358-9-2311 6674, mob. +358-50-329 6275,  fax +358-9-2311 6601
http://www.atbusiness.com, email: [EMAIL PROTECTED]


Reply via email to