|
From: Claudio V. C. <cv...@us...> - 2002-01-26 08:14:11
|
From parse.y:
for_select : FOR select INTO variable_list cursor_def DO proc_block
singleton_select : select INTO variable_list ';'
proc_outputs : RETURNING_VALUES variable_list
| RETURNING_VALUES '(' variable_list ')'
Notice the three constructions shown above use variable list. This is a
typical comma-separated list of variables. How could you assign those
results to other things apart from variables? However:
variable_list : variable
| column_name
[snip]
;
variable : ':' symbol_variable_name
column_name : simple_column_name
| symbol_table_alias_name '.' symbol_column_name
| symbol_table_alias_name '.' '*'
simple_column_name : symbol_column_name
More than a month ago, I squashed several bugs in one, that allowed defining
things like
declare variable a.* int;
or
foreign key(a.*) references (t.*);
that killed the engine. Now I'm seeing that, according to the syntax show
above, it's possible to write things like
select ... into :var;
select ... into col_name;
select ... into tbl_name.col_name;
select ... into tbl_name.*;
execute procedure p(...) returning_values tbl_name.*;
Do those make sense? The only one that makes sense for me is the first one,
the typical var name where the INTO's result goes.
Maybe this explains why some people insist that the INTO clause doesn't need
a colon before the var name and they get strange results?
Did I forget something too basic here?
C.
---------
Claudio Valderrama C.
Ingeniero en Informática - Consultor independiente
http://www.cvalde.com - http://www.firebirdSQL.org
|