oculus icon indicating copy to clipboard operation
oculus copied to clipboard

Can't use MySQL @-variables in queries

Open acrookston opened this issue 13 years ago • 0 comments

Try this query:

set @now = (select convert_tz(now(), '-07:00', '-0:00'));
set @newest_date = (select date_add(@now, interval -18 hour));

Notice the MySQL server will respond with:

Problem! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'set @newest_date = (select date_add(@now, interval -18 hour))' at line 3

Without having troubleshooted this issue, I think it's a parsing bug.

acrookston avatar Nov 08 '12 20:11 acrookston