Subject Re: [IBO] IB_lookupcombo: I'm missing someething.
Author Helen Borrie
At 09:43 AM 12/07/2005 -0400, you wrote:
>Are there any step by step directions for using the IB_LookupCombo?
>
>I thought I had it, but ....
>
>I have a lookup field that can take an integer 1..5, and a string that
>is mapped to each of these values in a separate table (my lookuptable)
>
>In a grid's query, I am displaying a field with the lookupnames using a
>subquery.
>
>main query (IB_QUERY1) (has an attached Dataset )
>SQL:
>SELECT T."ID",T."SHORTDESC",
> ( Select C."LOOKUPNAME"
> from "TODOCAT" C
> where T.CATEGORY = C."LOOKUPV") as LOOKUPNAME,
> T.CATEGORY
>FROM "TODOS" T
>
>
>The only strangeness here is that the edit queries need the following
>quoting:
>update "TODOS "
>set
> shortdesc= :shortdesc,
> category = :Category
>where
> ID = :OLD_ID
>
>(This may be the problem and may be related to the tools I am using with
>FIREBIRD to layout my tables)

It's part of the problem. If you define objects with quoted identifiers
then you are stuck with having to use the quoted identifiers
everywhere. Recommendation: if you don't need quoted identifiers then
recreate the database without them and pump in your data.


>Lookupquery
>SQL:
>select LOOKUPV, LOOKUPNAME
>from "TODOCAT" C
>
>Keylinks: TODOCAT.LOOKUPV=TUDOS.CATEGORY

This might another part of your problem. Is the keysource table called
"TODOS" or "TUDOS" ? and you'll need those danged quotes, too.

Also it looks likely you'll need KeyDescLinks, too, to match up the
subqueried LOOKUPNAME virtual field with the display values in the lookupcombo.


>KeySource = IB_Datasource1 (which is attached to query 1)
>
>When I activate the second query, it complains that the keylinks are
>invalid.

Helen