Subject | Re: [IBO] Cursors |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2002-09-09T13:10:45Z |
Hi Malcolm,
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
>My question is whether this is the most efficient method (required toNo, it isn't. You could save quite a bit if you just skipped preparing for
>prepare/close on each iteration).
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