in reply to Unable to run SQL query
You're using double quotes to quote your string, but your string also contains double quotes:
my $sth = $dbh->prepare("SELECT SUBSTR(row_data, 2, INSTR (row_data ... REPLACE (SUBSTR (row_data, INSTR (row_data, '~', 1, 22) + 2),' "',' ') ...
Either escape the double quotes or better use heredocs or a different quoting mechanism:
ormy $sql = <<SQL; SELECT SUBSTR(row_data, 2, INSTR (row_data ... REPLACE (SUBSTR (row_data, INSTR (row_data, '~', 1, 22) + 2),' "', +' ') ... SQL
my $sql = qq{ SELECT SUBSTR(row_data, 2, INSTR (row_data ... REPLACE (SUBSTR (row_data, INSTR (row_data, '~', 1, 22) + 2),' "', +' ') ... };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unable to run SQL query
by Rocko19 (Acolyte) on Sep 07, 2009 at 10:18 UTC | |
by Mr. Muskrat (Canon) on Sep 07, 2009 at 13:49 UTC | |
by graff (Chancellor) on Sep 07, 2009 at 18:00 UTC |