baperl has asked for the wisdom of the Perl Monks concerning the following question:
in my table, col7 is described asmy $ins_rec = "INSERT INTO $tbl_name (col1, col2, col3, col4, col5, co +l6, col7) VALUES (?,?,?,?,?,?,?);"; $sth=$dbh->prepare($ins_rec) or die $dbh->errstr; $sth->execute($col1, $col2, $col3, $col4, $col5, $col6, $col7) or die +$sth->errstr;
however, when I execute the program, I get the following error:col7 ENUM('N','Y') NOT NULL DEFAULT 'N'
of course, when I remove col7, my program works fine. So, how do I fix the statement so I can insert col7 into my table. thanks!Global symbol "$col7" requires explicit package name at test.pl line 9 +6. Execution of test.pl aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: inserting enum column into mysql from Perl program
by onelesd (Pilgrim) on Sep 25, 2011 at 22:19 UTC | |
by baperl (Sexton) on Sep 25, 2011 at 22:28 UTC | |
by baperl (Sexton) on Sep 25, 2011 at 22:31 UTC |