Stored proc/ORDER BY question.
Posted in 1998
I have roughly the following SQL in a stored procedure:
FOREACH
SELECT VAL1, VAL2, VAL3
INTO RES1, RES2, RES3
FROM ATABLE
WHERE VAL1 = whatever
ORDER BY VAL3
[blah blah blah]
END FOREACH;
Now, I assume that the SELECT only executes and saves
its results in a temporary area. Now my questions. Does
it save a copy of each record in the temporary area, or
does it save some sort of temporary index pointing to the
data? Assuming no transactions or overt locking, is this
construct guarenteed to return sequential values of VAL3,
or could it return a non-sequential value if another process
updates the record while processing a previous one?
Thanks in advance!
----------
Michael Benveniste
mike.benveniste@fmr.com
Any comments or statements made are not necessarily those of Fidelity
Investments, its subsidiaries, or affiliates.