Just another Perl shrine | |
PerlMonks |
Re (3): Perl DBI Insert rowby VSarkiss (Monsignor) |
on Nov 26, 2003 at 17:32 UTC ( [id://310326]=note: print w/replies, xml ) | Need Help?? |
No, it isn't. The error you're getting is that the string data (for example, 7000) will not fit into the intended column. If you want to insert the number 7000, omit the quotes. You can forget about all this with DBI by using placeholders. Your statement would be something like: The nice thing is that Perl offers you many ways to tidy that up. For example, if you have an array containing the values to be inserted, you can pass that to execute. Also, you can format the SQL string using all the power of the language. My personal preference is usually something like this (this isn't working code, just an example):
HTH UPDATE
In Section
Seekers of Perl Wisdom
|
|