laziness, impatience, and hubris | |
PerlMonks |
building sql statementby mwill007 (Initiate) |
on Jul 25, 2016 at 17:42 UTC ( [id://1168483]=perlquestion: print w/replies, xml ) | Need Help?? |
mwill007 has asked for the wisdom of the Perl Monks concerning the following question: I have to update database manually alot, so I wrote an app that reads the first line of a csv file and creates the headers/tables for an insert or update statement. The next lines are the data in the file. I build the statement like so
when I print the value of $insertsqlstatement is equal to INSERT INTO database.database(site_id, site_store_type, project, site_city, site_state, site_country, project_begin ) VALUES ('9999','SC OSR','Prebuild','Penfield','NY','US','8/8/2016 ') I can copy it an it runs just fine in sql Buy when i write from my sql statement it will not write sqlexec($insertsqlstatement); But if i manualy set the value of $insertsqlstatement = "INSERT INTO database.database(site_id, site_store_type, project, site_city, site_state, site_country, project_begin ) VALUES ('9999','SC OSR','Prebuild','Penfield','NY','US','8/8/2016 ')"; The sqlexec($insertsqlstatement); executes and updates the database
Back to
Seekers of Perl Wisdom
|
|