Subject | Re: [IBO] Lookup field with TIBQuery |
---|---|
Author | Helen Borrie |
Post date | 2005-02-21T21:18:11Z |
At 08:06 PM 21/02/2005 +0000, you wrote:
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 true.
You must include the primary key of Antena in the set. I've assumed it is
ID_FABRICANTE but, if there are other elements in the key, include those as
well. Those fields must be your KeyLinks.
Set your KeyLinks and set RequestLive true.
You *can* do this with the left join, too, but that way you would not be
able to take advantage of the correlated TIB_LookupCombo for the lookup set.
In that case, you would need to fix up your query, so that the primary key
of Antena is in the set, set KeyLinks, set Antena to be the KeyRelation and
set RequestLive true.
Make sure you use TIB_Query, though. TIBQuery is not compatible with IBO.
Helen
>Hi!TIB_Query?
>
>I´m trying to use the component TIBQuery
>and make a join with aIt is not a join you want here, but a correlated subquery:
>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.DESCRICAO,
> ANTENA.GANHO
>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 the
>TIB_Query.
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 true.
You must include the primary key of Antena in the set. I've assumed it is
ID_FABRICANTE but, if there are other elements in the key, include those as
well. Those fields must be your KeyLinks.
Set your KeyLinks and set RequestLive true.
You *can* do this with the left join, too, but that way you would not be
able to take advantage of the correlated TIB_LookupCombo for the lookup set.
In that case, you would need to fix up your query, so that the primary key
of Antena is in the set, set KeyLinks, set Antena to be the KeyRelation and
set RequestLive true.
>Is that possible or I have to use the TIBOTable to do thatNo, table components can't be used for SELECT statements.
>(just like the TTable) ?
Make sure you use TIB_Query, though. TIBQuery is not compatible with IBO.
Helen