Subject | Aliases in select in stores procedure |
---|---|
Author | ygboro |
Post date | 2007-10-02T00:18:57Z |
Hello,
a select statement using alias for a system table doesn't compile. For
example:
select fl.rdb$field_length
from rdb$relation_fields as rf
join rdb$fields as fl
on rf.rdb$field_source = fl.rdb$field_name
where rf.rdb$relation_name = :ctable and rf.rdb$field_name = :cfield
into :nlength;
Compilation complains - parsing error on the table name after the word
join.
But the very same statement in a plain script runs wihtout any problem
(without the into clause).
When using full table names instead of aliases rf, fl, then the
procedure compiles ok.
What am I doing wrong with aliasing, please ?
Boro
a select statement using alias for a system table doesn't compile. For
example:
select fl.rdb$field_length
from rdb$relation_fields as rf
join rdb$fields as fl
on rf.rdb$field_source = fl.rdb$field_name
where rf.rdb$relation_name = :ctable and rf.rdb$field_name = :cfield
into :nlength;
Compilation complains - parsing error on the table name after the word
join.
But the very same statement in a plain script runs wihtout any problem
(without the into clause).
When using full table names instead of aliases rf, fl, then the
procedure compiles ok.
What am I doing wrong with aliasing, please ?
Boro