Execute expects an array.
$sth->execute( ($host, $mensaje) ) or die $dbh ->errstr;
$sth->execute( @myinsertdata ) or die $dbh ->errstr;
-----Original Message-----
From: Ruben Montes [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2003 1:11 PM
To: '[EMAIL PROTECTED]'
Subject: Problems doing INSERT
Hello everybody,
I'm trying to do a simple INSERT into a PostgreSQL database with the
following perl DBI script:
$dbh = DBI->connect("dbi:PgPP:dbname=$dbname",$username,$password);
$sth = $dbh -> prepare("INSERT INTO syslog (host, mensaje) VALUES (?,?)") or
die $dbh->errstr;
$sth->execute( $host, $mensaje ) or die $dbh ->errstr;
$dbh -> disconnect;
And I get this error...
DBD::PgPP::st execute failed: ERROR: array_in: Need to specify dimension
ERROR: array_in: Need to specify dimension
I think it�s quite simple but I can't guess where the error is... Can you
help me?
Regards,
Ruben