[CDBI] mysql execute failed

k meehl kmeehl at yahoo.com
Wed Mar 14 19:21:36 GMT 2007

When running this code:
my $cdDef = testdb::table1->insert({
        testCol1 => 'testVal1',
        testCol2 => 'testVal2',
        testCol3 => 'testVal3'


I receive the following error:

Can't insert new testdb::table1: DBD::mysql::st
execute failed: You
have an error in your SQL syntax; check the manual
that corresponds to
your MySQL server version for the right syntax to use
near 'testCol2)
VALUES ('testVal1', 'testVal3', 'testVal2')' at line 1
[for Statement
"INSERT INTO table1 (testCol1, testCol3, testCol2)
VALUES (?, ?, ?)
" with ParamValues: 1='testVal3', 0='testVal1',
2='testVal2'] at /usr/
lib/perl5/site_perl/5.8.5/DBIx/ContextualFetch.pm line
 at ./test.pl line 5

It looks like the querty isn't being properly
converted to valid SQL. This error also occurs using

Relavent Info:
Class::DBI 3.0.16
DBD::mysql 4.003
DBI 1.54
Perl v5.8.6
MySQL 5.0.27
RHEL 4.1

I am at a complete loss as to where to look to resolve
this error. If anybody can help, or at least point me
in a general direction, it would be greatly


Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.

More information about the ClassDBI mailing list