Subject Re: [firebird-support] Aliases in select in stores procedure
Author Alexandre Benson Smith
ygboro wrote:
> 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
>

try this one:

select fl.rdb$field_length
from rdb$relation_fields rf
join rdb$fields fl
on rf.rdb$field_source = fl.rdb$field_name
where rf.rdb$relation_name = :ctable and rf.rdb$field_name = :cfield
into :nlength;


see you !


--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br