Subject | Re: [IBO] Column does not belong to referenced table - Bug report |
---|---|
Author | omar l m rosa |
Post date | 2007-02-07T17:29:34Z |
HI! ... Again... Be pacient... I can´t see where is the error...
I read the FB release notes 2.0.0 again, and I found at page 40-41 something about it, and the sql sentence IMHO is correct.
select f.*
from folha f
where f.pk_funcionarios = :pk_funcionarios and
f.mes_referencia = :mes_referencia and
exists(select pk_tb_fpg_cod
from tb_fpg_cod
where vencim_desc in (4,7) and
pk_tb_fpg_cod = f.pk_tb_fpg_cod)
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?
Look! Why If I remove the "f." alias, changing by "folha." (only in exists sql) IboQuery runs ok all the time?
Some like:
select *
from folha
where pk_funcionarios = :pk_funcionarios and
mes_referencia = :mes_referencia and
exists(select pk_tb_fpg_cod
from tb_fpg_cod
where vencim_desc in (4,7) and
pk_tb_fpg_cod = folha.pk_tb_fpg_cod)
-----------------------------
Thanks for your attention! Is important to me know more about Firebird!
Does'nt cry. Exists a tear rolling of your face? 8:)))
By!
omar
I read the FB release notes 2.0.0 again, and I found at page 40-41 something about it, and the sql sentence IMHO is correct.
select f.*
from folha f
where f.pk_funcionarios = :pk_funcionarios and
f.mes_referencia = :mes_referencia and
exists(select pk_tb_fpg_cod
from tb_fpg_cod
where vencim_desc in (4,7) and
pk_tb_fpg_cod = f.pk_tb_fpg_cod)
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?
Look! Why If I remove the "f." alias, changing by "folha." (only in exists sql) IboQuery runs ok all the time?
Some like:
select *
from folha
where pk_funcionarios = :pk_funcionarios and
mes_referencia = :mes_referencia and
exists(select pk_tb_fpg_cod
from tb_fpg_cod
where vencim_desc in (4,7) and
pk_tb_fpg_cod = folha.pk_tb_fpg_cod)
-----------------------------
Thanks for your attention! Is important to me know more about Firebird!
Does'nt cry. Exists a tear rolling of your face? 8:)))
By!
omar
----- Original Message -----
From: Helen Borrie
To: IBObjects@yahoogroups.com
Sent: Wednesday, February 07, 2007 8:45 AM
Subject: Re: [IBO] Column does not belong to referenced table - Bug report
At 11:32 PM 7/02/2007, you wrote:
>Sorry if I don´t became to understand;
>
>The problem is: Need I alter all sql sentences in my application???
>The problem is "column uknown" in a correct sql
>sentence! (runnning at least 2 years with old IBO version)
It's not an correct SQL sentence, and now it is illegal syntax in Firebird 2.
>The problem is the sentence created by the
>component iboquery in editsql: UPD TE SET WHERE RDB$DB_KEY = :DB_KEY
>The problem is the sentence created by the
>component iboquery in insertsql: INSER) INTO (VALUES )
Would you please read my answer again. You
cannot use the query editor for automatically
creating DML statements for joined sets. You
will need to write an executable stored procedure
and make the appropriate calls to this SP in the
InsertSQL, EditSQL and DeleteSQL properties of the IBOQuery.
But first, correct your SELECT statement and set
your KeyLinks. I would give you the syntax for
the corrected statement, except that might
encourage you to ignore the tightened enforcement
of syntax in Fb 2. :-) So read the release notes
and make the correction yourself.
Helen
[Non-text portions of this message have been removed]