I'm new to DBI and my needed is very easy; be able to
SELECT a table from a DB2 database, here is the code:
use DBI;
$data_source="dbi:DB2:steph";
$username="db2admin";
$password="nat12345";
$dbh = DBI->connect($data_source, $username,
$password) or die "Database connection not made:
$DBI::errstr";
my $sql = qq{ SELECT * FROM TOTO };
my $sth = $dbh->prepare( $sql );
$sth->execute();
$dbh->disconnect;
But this produce this error:
DBD::DB2::db prepare failed: [IBM][CLI Driver][DB2/NT]
SQL0204N "DB2ADMIN.TOTO" is an undefined name.
SQLSTATE=42704 DBD::DB2::st execute failed: [IBM][CLI
Driver] CLI0125E Function sequence error.
SQLSTATE=HY010 at C:\download\db.pl line 18.
DB2 is installed om my laptop, I'm able to connect
with access (ODBC).
The database is steph, the table is toto.
I also installed DBD::DB2
Any idea?
__________________________________________________________
Obtenez votre adresse @yahoo.ca gratuite et en fran�ais !
courriel.yahoo.ca
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs