Subject | Re: [ib-support] Update in SP |
---|---|
Author | Marco Lauria |
Post date | 2001-05-09T14:53:24Z |
At 09.53 09/05/2001 -0400, you wrote:
where can I get some informations about this undocumented mechanism?
Regards
Marco Lauria
> >At 11:17 AM 09-05-01 +0300, Dorin wrote:which is this?
> > >Hi everyone !
> > >How can I update a table in a SP using a FOR SELECT ... clause ?
> > >
> > >FOR SELECT <some columns> from <table> into <vars> DO BEGIN
> > > ... Here is the updating part ...
> > >END
>
>At 10:07 PM 5/9/2001 +1000, Helen Borrie wrote:
>
>
> >In a FOR SELECT loop on one table you can use the selected data to update
> >another table but not to update the one which is the subject of the
> loop, e.g.
>
>Helen must have been having an off day.
>
>Something like this will work:
>
> for select <primary key> from <table> where <condition>
> into <variable>
> do begin
> update <table> set <assignments> where <primary key> = <variable>
> end;
>
>There are a couple of variants that might be slightly faster (using
>the undocumented cursor mechanism or db_keys) but as all the structures
where can I get some informations about this undocumented mechanism?
Regards
Marco Lauria