Subject RE: [IBO] Updating left outer join
Author Paul Hope
> -----Original Message-----
> From: IBObjects@yahoogroups.com
> [mailto:IBObjects@yahoogroups.com] On Behalf Of Helen Borrie
> Sent: 05 June 2006 14:47
> To: IBObjects@yahoogroups.com
> Subject: RE: [IBO] Updating left outer join
>
> At 10:08 PM 5/06/2006, you wrote:
>
> > >
> > > Try improving the syntax for the main query:
> > >
> > > select s.rec,s.shipment,s.whs,s.pid,s.qty,s.alloc,w.description
> > > from warehouses w
> > > left outer join shipment_allocations s
> > > on s.whs=w.ref
> > > WHERE s.shipment=:shipment and s.pid=:pid
> > >
> > > Helen
> > >
> >That breaks it, I always want the grid populated with fields from
> >warehouses even when there is no data in shipment_allocations.
> >Changing it as you suggest returns no rows ;-(
>
> That sounds suspect. Where did you test it?
>
> What's the PK of warehouses?
>
> Helen
>
Sounds logical to me ;-) if you put the conditions in the where clause you
are filtering the joined rows - result=none. However if you put them in the
join conditions you filter the right hand table only, therefore returning
the left table rows.

Tested in IBExpert. Tables have PK of rec.

Regards
Paul