in reply to Can't insert into for one column
You don't have quotes around your strings, so the db is interpreting cash (etc.) as column names. If you used placeholders instead of generating a new insert statement each time, you wouldn't have to worry about quoting.
Your code should look something like this (some error checking would probably be good to add):
my $insert_h = $dbh->prepare('INSERT INTO sales VALUES(?, ?, ?, ?, ?, +?)'); while (<DATA>) { $insert_h->execute(split); }
|
|---|