Subject Re: [IBO] key links for newbie
Author Svein Erling Tysvaer
At 10:01 12.06.2003 +0000, you wrote:
>a Newbie needs help

The best help for a newbie is the Getting Started Guide. It does cost a few
dollars (about $30 I think), but is very good (I consider it the best piece
of documentation ever written for IBO).

>If you find someone has already reply to this message please feel
>free to post I really need all of your opinions thanks.
>
>I find the help in the IBO insufficient, please bear with me. Help me
>truly understand the following TIB_query properties.

I agree that it sometimes is difficult to find what you are looking for -
particularly when you don't quite know what you're looking for.

>key links: ins't this is use for identifying the primary key or
>unique key for the table? Why is it I see it using it in other
>purposes like in TIB_lookupcombo? And I have seen an example like
>this table1.column1 = table2.colum1, table1.column2 =
>table2.column2 ... Iam confious...

The KeyLinks should contain what makes a row in you query unique, not
necessarily primary or unique keys.

>if i have a join sql like this "select m.name, d.description,
>d2.description from employee m inner join employeetype d on m.type =
>d.type inner join department d2 on m.department = d2.department". how
>do i fill up the keylink?
>
>before using IB Objects ... I don't see this kind of sql
>statement ... "select name,(select description from employeetype d
>where m.type = d.type) from employee m". But now I see this kind of
>sql statement appear in several examples with IB Objects. Is that
>kind of sql statement the same from this kind ... "select m.name,
>d.description from employee m inner join employeetype d on m.type =
>d.type? If not how do they differ?

Well, it would be closer if you used
"select m.name, d.description
from employee m
left join employeetype d on m.type = d.type"

This is practically the same as the subselect you started with, the only
difference being that the left join will not return an error in case of
multiple matches in employeetype. Using inner joins doesn't return anything
if no record can be found in employeetype, so that is different.

>join links: it says that it is use when we have implicit join
>statement ... what if I have this kind of sql statement ... "select *
>from table1 inner join table2 on table1.column1 = table2.column2". Do
>I have to use the join links?

No, JoinLinks is only necessary if you use the old SQL-89 notation.

>what is "FOR UDPATE" sql statement that I usually see at the end of
>some TIB_query.sql properties?

"FOR UPDATE" is something Firebird requires when you want to update
records. In IBO, you simply set RequestLive and then Jason takes care of
the rest.

Set