Subject | Does SUSPEND really suspend? |
---|---|
Author | Car |
Post date | 2009-11-04T16:27:27Z |
I have writen a stored proc that returns a result set of what it changed. It looks like this:
=======================================================
create procedure OUTER_STORED_PROC(INPUT integer)
returns (<all the columes>) as
declare variable ID2 integer;
begin
for select ID from TABLE_A where val = :INPUT into :ID2
do
begin
execute procedure INTERAL_STORED_PROC( :ID2) returning_values
<all the columes>;
suspend;
end
end;
=======================================================
Assume for a moment that the select ID from TABLE_A returns 10 rows. If the client simply calls OUTER_STORED_PROC but never reads any of the result set, does INTERAL_STORED_PROC get called only once, all ten times, or never?
=======================================================
create procedure OUTER_STORED_PROC(INPUT integer)
returns (<all the columes>) as
declare variable ID2 integer;
begin
for select ID from TABLE_A where val = :INPUT into :ID2
do
begin
execute procedure INTERAL_STORED_PROC( :ID2) returning_values
<all the columes>;
suspend;
end
end;
=======================================================
Assume for a moment that the select ID from TABLE_A returns 10 rows. If the client simply calls OUTER_STORED_PROC but never reads any of the result set, does INTERAL_STORED_PROC get called only once, all ten times, or never?