Subject RE: [IBO] Setting Up SQL Properties
Author Claudio Valderrama C.
Your code uses explicit JOIN syntax, so forget about JoinLinks, it's for
people that insist on writing
from t1, t2 where t1.f = t2.f
that's the old non-ANSI SQL way.

Write your whole sentence in the SQL property and it's done.

KeyLinks represent one or more fields that make up a unique identifier for
each record. If your query is R/O, you can set RequestLive to false and
forget about it. If you need to update your query, usually IBO detects the
needed fields automatically. Usually, KeyFields becomes automatically the
definition of your PK. In your case, you have only inner joins, so the PK of
any of the tables would do fine. You only need to include the PK fields of
one of the tables in your SELECT statement and maybe setup KeyRelation so
IBO knows what's the table you want to update. There are at least two
possibilities for more complex needs: the *SQL properties and the OnCustom*
events.

C.

> -----Original Message-----
> From: Jeff Kreider [mailto:tecbuilder@...]
> Sent: MiƩrcoles 17 de Enero de 2001 23:56
>
> I am having problems understanding when to use the KeyLinks,
> JoinLinks, etc. properties of a TIB_Query. Would someone please tell
> me what parts of the SQL statement below should go into what
> properties and why? Thanks! Should I or should I not use table
> aliases. I'm also in the midst of learning SQL and I was trying to
> use table aliases for all 3 tables. However, when I did, I got 1000's
> of rows instead of 4.
>
> SELECT PREFIX , FIRSTNAME, FAMILY.LASTNAME MAINLASTNAME
> , FM.LASTNAME OTHERLASTNAME, SUFFIX, MARITALSTATUS
> , BIRTHDAY, MEMBERTYPE_ID, GRADUATIONYEAR, GENDER
> FROM FAMILYMEMBER FM
> INNER JOIN FAMILY2MEMBER
> ON (FM.FAMILYMEMBER_ID = FAMILY2MEMBER.FAMILYMEMBER_ID)
> INNER JOIN FAMILY
> ON (FAMILY2MEMBER.FAMILY_ID = FAMILY.FAMILY_ID)
> WHERE FAMILY2MEMBER.FAMILY_ID = :familyid
> ORDER BY FIRSTNAME
>
> TIA for your help.
> Jeff Kreider
>
>
>
>
>