Subject Re: [IBO] Syntax of Links?
Author Helen Borrie
At 12:13 PM 18/11/2004 +0100, you wrote:

>Hi. all
>I'm new to IBO and I'm struggle with "syntax" of *Links in IBO Suite

If you are using the TDataset-compatible components then the *links
properties you would work with are simple TStringlists: one "link" per
line of the editor.


>There is a reference that explain where this links are used and in what
>sense?

In the IBO help.
In the Getting Started Guide...which is not a freebie...but you can pick up
TechInfo sheets from here that explain them in context:
http://www.ibobjects.com/TechInfo.html
Also use the searchable on-line FAQ at the website.


>Example,
>Links in TIBO_Query.KeyLinks are used when... with this syntax...

KeyLinks are used to tell the dataset the names of the output fields that
form the unique key of each row. For a query on a single table, this is
simply the columns of the primary key. So, taking a TIBOQuery whose SQL is

SELECT * FROM EMPLOYEE

The KeyLinks for this set would be one line:

EMP_NO

For an IBOQuery with this SQL:
SELECT EMP_NO, PROJ_ID FROM EMPLOYEE_PROJECT

the KeyLinks would be:
EMP_NO
PROJ_ID

Joined sets take a bit more working out.

>Links in TIBO_Query.KeyDescLinks are used when... with this syntax...

Not available to TIBOQuery. It's used as part of a linking for embedding
TIB_LookupCombo into a TIB_Grid.

Two more that are available to TIBOQuery are JoinLinks and
GeneratorLinks. You can ignore JoinLinks entirely if you are using
well-formed SQL-92 joins. If you are using the old SQL join syntax, for
example:

SELECT TableA.a, TableB.b from TableA , TableB
WHERE TableA.id = TableB.id
AND TableA.a > 100

you have search criteria and join criteria mixed up together in the WHERE
clause. For this syntax, use the JoinLinks to identify which criteria are
the join criteria. Here, it would be

TableA.id=TableB.id

For lots of reasons, you should avoid this syntax.

GeneratorLinks is for identifying any columns in your set that are
populated by a generator at insert time.

id=gen_pk_tableA

See also the examples in the Samples directory of your IBO installation.

Helen