[Melbourne-pm] SQL date calculations inside PERL
Daniel Pittman
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
> DBI:ODBC
Do you mean "how do I quote this so Perl doesn't interpret '@Date' as an
array expression?"
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
in question.
Regards,
Daniel
--
Digital Infrastructure Solutions -- making IT simple, stable and secure
Phone: 0401 155 707 email: contact at digital-infrastructure.com.au
http://digital-infrastructure.com.au/
More information about the Melbourne-pm
mailing list