Thanks for ur reply.. I'm not clear with what Corion said.. But as u said, the ineterpolated strings could be the problem... May be i'll try to execute with Single quotes.. But could u please tell, whether i can use the Perl variable in the SQL Scripts, as to extract the values from DB.. Like i used in above SQL Query...
| [reply] |
my $sql = "DECLARE \@log varchar(5) SET \@log=$tim Update dbo.tltime s
+et logtime = \@log";
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 "\@".
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
| [reply] [d/l] |
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.
Wrong. Most SQL engines require single quotes for values, and double quotes for otherwise illegal identifiers.
But don't use single-quotes, either. Use placeholders and only placeholders for any value passed to the database. Forget that quote exists at all. That method should be restricted to DBDs.
Use quote_identifier when you need to pass variable identifiers (most times, names of database objects like tables, views, columns, triggers, sequences, procedures) to the database.
Update: Sorry, I wrote nonsense.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] |