Hi to all,
I don’t understand very exactly your question,
because you refer to an UPDATE statement and, as per my
knowledge, for update statements you don’t need neither to
declare any cursor nor to fetch records from it.
You simply need to execute the SQL command.
Depending on your host environment, executing the command
may return the total number of records processed (in your
case the total number of records updated).
As my background ts Oracle, the update statement in your example would be rewritten as follows for more efficient
execution, of course, if your database syntax supports
Set ( s2prod, s2id, s2ach ) =
(SELECT s2prod, s2id, s2ach
WHERE workfile.sprod = sub2l12.s2prod
and workfile.sid = sub2l12.s2id
and workfile.smail = sub2l12.s2mail)
and this is because the 3 subquesries used for the 3 fields
are in fact identical.
Hope this helps,