in reply to DBI:Mysql sql string multiline error
In theory it shouldn't make a difference whether your SQL contains newlines and tabs ("\t"). What DBD and database (+version) are you using? What error message are you getting?
If you want to be sure to remove all those newlines and tabs before passing your SQL to the database, try the following subroutine which converts the tabs and newlines to spaces:
sub clean_sql { my $sql = shift; $sql =~ s/\s+/ /msg; $sql }; # and call it as my $sql = clean_sql("SELECT * FROM sometable ... ");
|
|---|