Subject | Re: [IBO] FieldByName with table alias |
---|---|
Author | Helen Borrie |
Post date | 2002-08-23T00:59:01Z |
At 12:48 AM 23-08-02 +0200, you wrote:
select * from customer custalias
left join copyto ctalias
on custalias.parentkey = ctalias.childkey
left join secondcopy scalias
on scalias.someotherkey = [see ** below]
WHERE ctalias.id=:copyto
AND scalias.id=:secondcopy
Consult the manual to find the correct syntax for joins.
The purpose of JOIN criteria is to provide the links between the joined
tables. They have to be identifiers of columns that exist and can be
linked (same data type and size).
The WHERE clause is used for passing search criteria, including parameters
if you want parameterised queries.
copyto.FieldByName('name').Value
or
copyto.FieldByName('name').AsString
Helen
>Hi!This syntax won't work.
>
>select * from table customer
>left join table copyto on copyto.id=:copyto
>left join table secondcopy on secondcopy.id=:secondcopy
select * from customer custalias
left join copyto ctalias
on custalias.parentkey = ctalias.childkey
left join secondcopy scalias
on scalias.someotherkey = [see ** below]
WHERE ctalias.id=:copyto
AND scalias.id=:secondcopy
Consult the manual to find the correct syntax for joins.
The purpose of JOIN criteria is to provide the links between the joined
tables. They have to be identifiers of columns that exist and can be
linked (same data type and size).
The WHERE clause is used for passing search criteria, including parameters
if you want parameterised queries.
>How can all fields be accessed via FieldByName?If copyto is the name of the query:
>
>FieldByName('name') or FieldByName('secondcopy.name') won't
>work...
copyto.FieldByName('name').Value
or
copyto.FieldByName('name').AsString
Helen