Subject Re: [IBO] Generate For Table (update sql in TIB_Query)
Author Helen Borrie
At 11:08 PM 26/06/2007, you wrote:
>I have also tried different combinations of setting KeyLinks, Key
>relation and i had no luck.

You should not set KeyRelation: leave it nil. KeyRelation has a
specific use, which is to target one table in a join as the "update table".

But, as I commented earlier, the invalid KeyRelation setting should
either be ignored, or cause an exception.

Helen



>Rade
>
>--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
> >
> > At 04:45 PM 26/06/2007, you wrote:
> > >I have a simple query
> > >
> > >SELECT B.BANKA_ID
> > >FROM BANKA B
> > >
> > >KeyRelation = B
> >
> > This doesn't belong (there are no joins and it is not valid to put a
> > relation alias in that property, anyway)
> >
> > But the parser should either ignore it (because it does not apply) or
> > it should complain, with an exception.
> >
> > >KeyLinks = BANKA_ID
> >
> > That should be OK, provided it is unique in your set.
> >
> >
> > >Button Generate forTable in UpdateSQL tab in TIB_Query Editor
> > >generates following SQL.
> > >
> > >EDIT:
> > >
> > >UPD TE SET
> > >WHERE
> > >RDB$DB_KEY = :DB_KEY
> > >
> > >
> > >
> > >INSERT:
> > >
> > >INSER) INTO (
> > >VALUES )
> > >
> > >
> > >DELETE:
> > >
> > >DELETE FROM
> > >WHERE
> > >RDB$DB_KEY = :DB_KEY
> > >
> > >
> > >What am i doing wrong (it is the same for interbase7.0 or firebird2.0)
> >
> > As mentioned; but invalid properties should not generate garbage
> > SQL, or ignore a good Keylink. What I think is *happening* with the
> > parser is that your KeyRelation setting is making it think it has to
> > deal with two tables and it has no KeyLinks that fit any table
>named "B".
> >
> > What build of IBO are you using? I wonder if you are trying to use
> > that 4.8 test build that Jason put up in the Trustware repository for
> > me at the weekend to test a bug-fix? (It didn't work....)
> >
> > Helen
> >
>
>
>
>
>___________________________________________________________________________
>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
>
>
>