Subject Re: [IBO] Live Result Set with Join?
Author Helen Borrie
At 10:03 AM 07-12-00 -0500, you wrote:
>Hi All,
>
>I'm using a TIBOQuery and requesting a live result set. My query is a very
>simple join:
>
>Select mc.MCatID, mi.MItemID, mc.MCatName, mi.MItemCode,
>mi.MItemName, mi.Price, mi.Sales
> >From MCat mc, MItem mi
>Where mc.MCatID = mi.MCatID
>Order by mc.MCatName, mi.MItemCode
>
>I'm then trying to edit the sales field and I get an error that I can't edit
>this field. Is there a restriction on getting a live result set with a
>join? Is there a way to structure my query to further reduce ambiguity if
>this is the problem?


Yes, use explicit join syntax, viz

Select mc.MCatID, mi.MItemID, mc.MCatName, mi.MItemCode,
mi.MItemName, mi.Price, mi.Sales
From MCat mc
JOIN MItem mi
ON mc.MCatID = mi.MCatID
Order by mc.MCatName, mi.MItemCode

and set MItem as the KeyRelation

Then put an update statement for MItem in the EditSQL property of the dataset.

You can only update one side of a joined dataset.

Helen


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________