Subject Re: [IBO] sql quesiton
Author Peter Lee
Thanks for that - works fine now!

PL

Svein Erling Tysvaer wrote:
> I think your KeyLinks should be the following two lines:
>
> i.entity_id
> a.address_id
>
> From your description of your error, I assume you forgot the last line.
>
> HTH,
> Set
>
> Peter Lee wrote:
>
>> Hello,
>>
>> Using Delphi 6 and FB1.5, IBO4.5Ai I have this query that works fine -
>> I get a list of people as expected. However, with some searches,
>> using TIB_Query.locate, I get an error 'Multiple rows in singleton
>> fetch' - Check KeyLinks and JoinLinks properties.
>>
>> It seems to happen when a particular individual has multiple
>> addresses. The locate statement only has one field - searching on
>> last name.
>>
>> Thanks,
>>
>> Peter Lee
>>
>> ===
>>
>> qIndividual.locate(fieldText, VarArrayFromStrings(fieldValues),
>> [lopCaseInsensitive, lopPartialKey]);
>>
>> ===
>>
>> select
>> i.entity_id,
>> i.name_last,
>> i.name_first,
>> i.type_customer,
>> i.type_general,
>> a.address_id,
>> a.city,
>> a.state,
>> a.main_address,
>> a.country_iso,
>> co.country_name,
>> i.ph_main,
>> i.ph_mobile,
>> i.name_company
>> from individual i
>> left outer join address a on i.entity_id = a.entity_id
>> left outer join country co on co.iso = a.country_iso
>> where (a.main_address = 1 or a.main_address is null) and
>> (i.type_general = 1)
>> order by UPPER(i.name_last), UPPER(i.name_first), UPPER(co.country_name)
>>
>
>
> ___________________________________________________________________________
> 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
>
>
>
>
>
>
>
>
>
>

--
Peter Lee ptle@...
-----------------------------------------------------------------------
Rising Software Australia Pty. Ltd. http://www.risingsoftware.com/
Publishers of 'Auralia' - Ear Training and 'Musition' - Theory Training
Ph: +61 3 9481 3320 FAX: +61 3 9481 3380 USA Freecall: 1 888 667 7839