ut 'use DBI;' at the top of your script. you can take it out of connect sub
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 21, 2002 9:22 AM > To: [EMAIL PROTECTED] > Subject: Re: DBI "Prepare" Statement Not Working > > > Okay thanks, I added "my $dbh;" prior to the subroutine and am still > receiving the same error. Here is the code: > > #!/usr/local/bin/perl > # > $ENV{'ORACLE_HOME'} = '/apps/oracle/product/8.1.7'; > $ENV{'NLS_LANG'} = 'AMERICAN_AMERICA.WE8ISO8859P1'; > $ENV{'NLS_DATE_FORMAT'} = 'DD-MON-RR'; > #$gdb_connect = substr($net_connect,1); > > my $dbh; > my $sth; > my @fields; > my @row; > my $cursor_x; > my ($rollup_code, $rollup_value, $french_flag); > > db_connect (); > db_statement (); > $dbh->disconnect; > #------------------------------------------------------------- > -------------------- > > sub db_connect > { > use DBI; > use strict; > > my $db_connect = 'DUMY'; > my $dbh = DBI->connect("dbi:Oracle:$db_connect","FMC","FMC") > or die "Database connection not made: $DBI::errstr"; > } > #------------------------------------------------------------- > -------------------- > > 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; > #my $rv = $sth->bind_columns(\$rollup_code, \$rollup_value, > \$french_flag); > > while ( @row = $sth->fetchrow_array ) { > print "@row\n"; > } > } > #------------------------------------------------------------- > ---------------------- > >
