Subject | Re: [IBO] Two editable and indexed columns from two tables |
---|---|
Author | Helen Borrie |
Post date | 2002-12-27T05:34:12Z |
Gerard J.M.Houtenbos wrote:
regarding the lookup mechanism that is implemented in the TIB_BDatasets. I
think your confusion arises from trying to make TIB_LookupCombo work with
the TDataset-compatible datasets. Gerard is using TIBOQuery and an
Infopower grid.
Gerard won't get the native ibo-like behaviour using TIBOQuery and your
suggestion to use a join will get him fairly close. The crucial problem
here is his desire to make the "lookup" field editable. There are ways to
do that. However, he can still go the subquery route, if that works better
for him.
You wrote:
the dependency between the IBO mechanisms and the metadata. OrderingLinks
can't be set up to work automatically on non-database columns, such as your
CaptainName example. The main problem here is that your example query
doesn't extract enough output columns to maintain the necessary links
(KeyLinks) to the underlying database columns. Provided the KeyLinks of
the joined set were spot-on, you could get the OrderingLinks button to
generate the "correct" mappings if your query were:
SELECT Players.P_Key, Players.Name,
Captains.P_Key, Captains.Name
FROM Players
JOIN Captains
ON Players.CaptainKey = Captains.P_Key
Notice that the JOIN criterion here is different to that in your example
(which is wrong, since it joins the two primary keys, instead of the
foreign key and the primary key respectively).
The KeyLinks here would be:
Players.P_Key
Captains.P_Key
heLen
> > >I tried a join-TIBOquery, but then the Captains.Name isn'tAt 04:57 PM 25/12/2002 +1030, Raymond Kennington wrote:
> > >editable.
> > >
> > >I tried to use a TIBOquery with a lookupfield for the
> > >Captains.Name, but then I can't index on the Captains.Name using
> > >OrderingItems.
>It's taken me 5 hours to work out how to do this.Raymond, sorry to spoil your little moment, but the GSG is correct
>
>There are 2 major problems here, one with the GSG and the other with
>IBObjects.
>
>1. This is because IBObjects Gettging Started Guide indicates that one should
>use a singleton select for the looked-up item rather than a join, so to start
>with, use a JOIN to get the looked-up item.
regarding the lookup mechanism that is implemented in the TIB_BDatasets. I
think your confusion arises from trying to make TIB_LookupCombo work with
the TDataset-compatible datasets. Gerard is using TIBOQuery and an
Infopower grid.
Gerard won't get the native ibo-like behaviour using TIBOQuery and your
suggestion to use a join will get him fairly close. The crucial problem
here is his desire to make the "lookup" field editable. There are ways to
do that. However, he can still go the subquery route, if that works better
for him.
You wrote:
>Let the SELECT statement beYou still seem to have difficulties and frustration from not understanding
>
>SELECT A.ID, A.Name, B.Name as CaptainName
> FROM A JOIN B on (B.ID = A.BID)
>
>2. The Create button on the OrderingLinks page incorrectly produces:
>
> CaptainName=CaptainName; CaptainName DESC
>and
> CaptainName=Item=1
>
>whereas it should have produced
>
> CaptainName=B.Name; B.Name DESC
>and
> CaptainName=Item=1
>The documentation and tool are letting us down here and that makes it very,
>very, very difficult and frustrating.
the dependency between the IBO mechanisms and the metadata. OrderingLinks
can't be set up to work automatically on non-database columns, such as your
CaptainName example. The main problem here is that your example query
doesn't extract enough output columns to maintain the necessary links
(KeyLinks) to the underlying database columns. Provided the KeyLinks of
the joined set were spot-on, you could get the OrderingLinks button to
generate the "correct" mappings if your query were:
SELECT Players.P_Key, Players.Name,
Captains.P_Key, Captains.Name
FROM Players
JOIN Captains
ON Players.CaptainKey = Captains.P_Key
Notice that the JOIN criterion here is different to that in your example
(which is wrong, since it joins the two primary keys, instead of the
foreign key and the primary key respectively).
The KeyLinks here would be:
Players.P_Key
Captains.P_Key
heLen