* Ajay Madan ([EMAIL PROTECTED]) [010529 09:38]:
> Hi,
>
> I recently tested and installed the DBI and DBD:Oracle modules.I am a
>beginner to using
> DBI to connect to the Database. My first task is to connect to an Oracle Database
>using a 7.3.4
> Oracle Client, with the SQL statement as "SELECT * FROM TAB"
>
> My program is as follows:
>
> #!/usr/local/bin/perl
>
> use DBI;
>
> my $dbuser = $ENV{ORACLE_USERID} || 's1_gwy/s1_gwy01';
> my $dbh = DBI->connect('DBI:Oracle:', $dbuser, '')
> or die "Couldnt connect to database: " . DBI->errstr;
> my $sth = dbh->prepare('SELECT * FROM TAB')
> or die "Couldn't prepare statement: " . $dbh->errstr;
> $sth->execute or die "Couldnt execute statement: " . $sth->errstr;
> $dbh->disconnect;
>
> When I executed the above piece of code I got the following error:
>
> Can't locate object method "prepare" via package "dbh" at ./fpgm2db line 9.
Try using '$dbh->prepare' instead of 'dbh->prepare' -- once you create
your database handle ($dbh) you might as well use it :-)
Chris
--
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.