Subject Re: [IBO] Cursors
Author Svein Erling Tysvaer
Hi Malcolm,

>My question is whether this is the most efficient method (required to
>prepare/close on each iteration).

No, it isn't. You could save quite a bit if you just skipped preparing for
each iteration, but best of all would be to just do it all in one go:

UPDATE <DBSpriteDetail>
SET <IPAddress> = (SELECT IPL_IPADDRESS FROM IPLOOKUP WHERE IPLOOKUP.ID =
<DBSpriteDetail.IPLookupID>),
<Local> = (SELECT IPL_LOCAL FROM IPLOOKUP WHERE IPLOOKUP.ID =
<DBSpriteDetail.IPLookupID>)
WHERE EXISTS (SELECT 1 FROM IPLOOKUP WHERE IPLOOKUP.ID =
<DBSpriteDetail.IPLookupID>)

and please make sure you do it on a test database first, 'cause I don't
want any blame if I wrote something wrong here.

HTH,
Set