Subject RE: [IBO] Updating left outer join
Author Paul Hope
Hi Helen


> -----Original Message-----
> From: IBObjects@yahoogroups.com
> [mailto:IBObjects@yahoogroups.com] On Behalf Of Helen Borrie
> Sent: 05 June 2006 12:57
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Updating left outer join
>
> At 09:42 PM 5/06/2006, you wrote:
> >Hi
> >
> >I have this query connected to a grid
> >
> >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 and s.shipment=:shipment and s.pid=:pid)
> >
> >in the EditSQL I have
> >
> >execute procedure shipment_alloc_edit(:shipment,:pid,:qty,:whs)
> >
> >:shipment comes from MasterParams and MasterSource :qty is
> entered in
> >the grid :pid is set in code AfterPrepare (ParamByName) :whs
> is one of
> >the fields extracted in the SQL
> >
> >When I look at the SQLMonitor I see that when the query is
> opened both
> >:shipment and :pid are correctly set. However when the InsertSQL is
> >executed :shipment and :qty are set, but :pid and :whs are null.
> >
> >How can I persuade it to pick up :pid and :whs?
>
> 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 ;-(

Regards
Paul