Subject Re: [IBO] Column does not belong to referenced table - Bug report
Author Svein Erling Tysvaer
omar l m rosa wrote:
> I try to put explicitly alias in deep select like this:( to eliminate
> ambiguous reference)
>
> select f.*
> from folha f
> where f.pk_funcionarios = :pk_funcionarios and
> f.mes_referencia = :mes_referencia and
> exists(select c.pk_tb_fpg_cod
> from tb_fpg_cod
> where c.vencim_desc in (4,7) and
> c.pk_tb_fpg_cod = f.pk_tb_fpg_cod)
>
> And nothing change...
> the error (column does not belong...) occurs only after a iboquery.refresh.=
> Before, runs ok.
>
> Please, where is the error in sql sentence?

If this is truly copied from your database, then the error is that you
don't specify 'as c', and hence 'c.' will invariably fail.

If you copy this code:

select *
from folha f
where f.pk_funcionarios = :pk_funcionarios and
f.mes_referencia = :mes_referencia and
exists(select 1
from tb_fpg_cod c
where c.vencim_desc in (4, 7) and
c.pk_tb_fpg_cod = f.pk_tb_fpg_cod)

do you still get an error?

HTH,
Set