Subject | Re: [IBO] Lookup field with TIBQuery |
---|---|
Author | marcoandrecarvalho |
Post date | 2005-02-23T18:43:16Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
Thank you! It worked just fine. Thank you again!
[]s, Marco André
> At 08:06 PM 21/02/2005 +0000, you wrote:ANTENA.DESCRICAO,
>
>
> >Hi!
> >
> >I´m trying to use the component TIBQuery
>
> TIB_Query?
>
> >and make a join with a
> >table. Here is the tables:
> >
> >TABLE FABRICANTE:
> > CD_FABRICANTE SMALLINT NOT NULL,
> > NM_FABRICANTE VARCHAR(30) NOT NULL
> >
> >TABLE ANTENA:
> > CD_ANTENA SMALLINT NOT NULL,
> > ID_FABRICANTE SMALLINT,
> > DESCRICAO VARCHAR(40) NOT NULL,
> > GANHO FLOAT NOT NULL
> >
> >I´m using the folowing SQL to do this:
> >
> >SELECT FABRICANTE.NM_FABRICANTE, ANTENA.CD_ANTENA,
> > ANTENA.GANHOthe
> >FROM ANTENA
> > LEFT OUTER JOIN FABRICANTE ON (ANTENA.ID_FABRICANTE =
> >FABRICANTE.CD_FABRICANTE)
>
>
> >The question is: How can I do a query which gives me the ability to
> >edit that join? I want to simulate a LookupField in table ANTENA
> >(FABRICANTE.NM_FABRICANTE). I dont know if you understand... I just
> >want to edit the values (NM_FABRICANTE) of the above query, using
> >TIB_Query.true.
>
> It is not a join you want here, but a correlated subquery:
>
> SELECT
> A.ID_FABRICANTE,
> (SELECT
> F.NM_FABRICANTE from FABRICANTE F
> WHERE F.CD_FABRICANTE = A.ID_FABRICANTE) as FabName,
> A.CD_ANTENA,
> A.DESCRICAO,
> A.GANHO
> FROM ANTENA A
> WHERE A.SOMETHING = :SOMETHING....
>
> In the ColumnAtrributes, set the COMPUTED property of FabName to be
>assumed it is
> You must include the primary key of Antena in the set. I've
> ID_FABRICANTE but, if there are other elements in the key, includethose as
> well. Those fields must be your KeyLinks.not be
>
> Set your KeyLinks and set RequestLive true.
>
> You *can* do this with the left join, too, but that way you would
> able to take advantage of the correlated TIB_LookupCombo for thelookup set.
>primary key
> In that case, you would need to fix up your query, so that the
> of Antena is in the set, set KeyLinks, set Antena to be theKeyRelation and
> set RequestLive true.with IBO.
>
> >Is that possible or I have to use the TIBOTable to do that
> >(just like the TTable) ?
>
> No, table components can't be used for SELECT statements.
>
> Make sure you use TIB_Query, though. TIBQuery is not compatible
>Hi Helen,
> Helen
Thank you! It worked just fine. Thank you again!
[]s, Marco André