Subject Re: TIBOTable.Locate on a lookup field fails
Author masonwheeler
I think you'd have to do it as a scan, simply because there's no guarantee that the lookup target dataset would even be an IBO dataset in the first place.

Of course, if it *is* an IBO dataset, you can probably optimize things by taking advantage of the other dataset's query definition to turn it into a JOIN.

Mason

--- In IBObjects@yahoogroups.com, "IBO Support List" <supportlist@...> wrote:
>
> To support this I will have to make the SQL parsing engine put an underlying
> column so that it will be supported. This could take me a little while to
> implement this.
>
> Alternatively, I could have it detect this and then just do a scan of
> records in the buffer to try and find a match. But, that wouldn't reap the
> benefit of the SQL parsing engine to optimize the Locate() on the server if
> possible. It would just be a simple record scan on the client.
>
> Jason
>
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
> Of masonwheeler
> Sent: Thursday, April 18, 2013 11:45 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] TIBOTable.Locate on a lookup field fails
>
> Got another fun one for you.
>
> Create two database tables, linked by a FK relationship.
>
> Create two TIBOTable objects, one for each table.
>
> Use the form designer to create persistent fields for one of the TIBOTable
> datasets. Give it the fields the underlying table has, plus one more, a
> field of FieldKind fkLookup, that looks up a property on the other dataset,
> using the FK relationship.
>
> Create a routine that tries to call Locate on this dataset, and use the
> lookup field for the Locate key field.
>
> Expected: It should work. This will work on normal datasets.
>
> Observed: EIB_StatementError. FieldName: [lookup field name] not found.
>
> It appears to be looking for the field in the underlying dataset, and then
> bailing when it's not found.
>
> Mason
>
>
>
> ------------------------------------
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>