Subject Re: [ib-support] Still have problems updating many-to-many in SP
On 15 Mar 2002 at 8:08, Alan J Davies wrote:

>Update Delitems
>Set Inv_Nmbr=(Select InvHead.Inv_Nmbr From InvHead
>Inner Join DelItems DI on DI.Acno=InvHead.Acno
>Where DI.Delivered='N'
>And InvHead.Delivered='N')

Try this:

Create procedure AssignNewNumbers AS
Declare variable AAcno VarChar(10);
Declare variable AInv_Number Integer;
For select Acno, Inv_Nmbr From InvHead
Where InvHead.Delivered='N' into :AAcno, :AInv_Number DO
Update DelItems set Inv_Number=:AInv_Number
Where Acno=:Acno and Delivered='N';

This procedure works exactly as yor Delphi "cheat", but
I'm afraid that that is not what you really need.

SY, Dimitry Sibiryakov.