in reply to Re^3: MySQL INSERT in Perl
in thread MySQL INSERT in Perl
I am perplexed...it says do failed, but it did insert the records and it does it all correctly...then why the error? this is my updated code:DBD::mysql::db do failed: Unknown column 'N' in 'field list' at otest. +pl line 52.
my $dbh=DBI->connect($dsn,$user,$pwd); foreach my $hr1 (@calls) { my %h1 = %{$hr1}; next unless defined $h1{'symbol'}; my $ins_rec="INSERT INTO $table (symbol,valuation_dt,expn_dt,strik +e,open,bid,ask,last,volume) VALUES(\'$h1{'symbol'}\',now(),\'$exp\',$ +h1{'strike'},$h1{'open'},$h1{'bid'},$h1{'ask'},$h1{'last'},$h1{'volum +e'});"; print "my ins_rec is $ins_rec\n"; my $sth=$dbh->do($ins_rec); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: MySQL INSERT in Perl
by afoken (Chancellor) on Aug 04, 2011 at 19:40 UTC |