in reply to Re^2: SQL Query error while executing in perl. Is it possible to execute these Scripts??
in thread SQL Query error while executing in perl. Is it possible to execute these Scripts??
Your line needs to change to:
Notice that the "@" signs need to be escaped - because "@log" is intended for the SQL server, not perl. perl needs to be told to ignore the @, which you do by expressing it as "\@".my $sql = "DECLARE \@log varchar(5) SET \@log=$tim Update dbo.tltime s +et logtime = \@log";
On the other hand, you wan to tell SQL the value contained in the perl "$tim" variable, so you require perl's interpolation for THAT variable, so , use double-quotes.
Syntactic sugar causes cancer of the semicolon. --Alan Perlis
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: SQL Query error while executing in perl. Is it possible to execute these Scripts??
by afoken (Chancellor) on Dec 06, 2010 at 15:23 UTC | |
by mje (Curate) on Dec 06, 2010 at 16:11 UTC | |
by afoken (Chancellor) on Dec 08, 2010 at 12:58 UTC | |
by NetWallah (Canon) on Dec 07, 2010 at 05:59 UTC | |
by afoken (Chancellor) on Dec 08, 2010 at 13:03 UTC |