[Melbourne-pm] SQL date calculations inside PERL
daniel at rimspace.net
Sat Nov 4 04:30:18 PST 2006
Peter Machell <peter at machell.net> writes:
> The following is SQL I need to pump into an array. How do I do this
> without PERL seeing @foo as a global variable? I'm connecting with
Do you mean "how do I quote this so Perl doesn't interpret '@Date' as an
To do that you can either put it inside '' marks or escape using \
before the '@' character.
If not please restate the question, since it isn't clear, I think.
> DECLARE @Date DATETIME;
> SET @Date = FLOOR(CONVERT(FLOAT, GETDATE()));
"DECLARE \@Date DATETIME;"
'SET @Date = FLOOR(CONVERT(FLOAT, GETDATE()));'
...mostly, the fact that none of this contained the '@foo' literal made
me think that you mean that as a generic term and '@Date' was the code
Digital Infrastructure Solutions -- making IT simple, stable and secure
Phone: 0401 155 707 email: contact at digital-infrastructure.com.au
More information about the Melbourne-pm