|
Posted by Bill Karwin on September 13, 2005, 10:08 am
Please log in for more thread options Malcolm Dew-Jones wrote:
> User variables may be used where expressions are allowed. This
> does not currently include contexts that explicitly require a
> literal value
>
> In other words, things like
> SELECT * FROM table WHERE col1 = @a_value;
> will work but
> SELECT * FROM @table_name;
> will not work because the table name must be a literal value, not an
> expression.
Well, to be accurate, a table name is not a literal value. A table name
is a reference to some schema object. A literal value is something like
"abc" or 12.
I would guess (without having tried it ;-) that the comment about
literal values refers to contexts like the arguments of the LIMIT
clause, which take literal integer values, but not expressions or
parameters. That is, the following would not be permitted:
SELECT * FROM table LIMIT @a, @b;
Regards,
Bill K.
|