Subject | Re: [firebird-support] Execute Statement & Row_Count in SP |
---|---|
Author | Helen Borrie |
Post date | 2004-06-18T15:07:51Z |
At 04:39 PM 18/06/2004 +0200, you wrote:
The procedure doesn't know what's happening in the EXECUTE STATEMENT
call. It doesn't have any way of knowing what is in that string at compile
time, so that it might set up the row_count. Even at run time, it only
knows to send a string out to the DSQL processor: it doesn't validate
what's in the string, other than that it is a well-formed string.
Read the release notes regarding EXECUTE STATEMENT. Really, it's just a
useful hack. It's not the magic bullet you want it to be.
Please would you refrain from repeatedly subscribing and
unsubscribing? You cause unnecessary work for moderators, who are
volunteers, not public servants. If you want to stop getting email, go to
your settings on the list's main page and set your delivery option to "No
email". You'll still have posting rights.
^heLen
>Hi,No.
>
>In a SP I have the following lines:
>
>.
>.
>EXECUTE STATEMENT
>'UPDATE ATAB SET ' || UPDATECLAUSE || ' WHERE ' || WHERECLAUSE;
>ROWSAFFECTED = ROW_COUNT;
>.
>.
>
>The DML statement works fine but ROW_COUNT returns 0 even when a row has
>been updated.
>Doesn't EXECUTE STATEMENT set ROW_COUNT?
The procedure doesn't know what's happening in the EXECUTE STATEMENT
call. It doesn't have any way of knowing what is in that string at compile
time, so that it might set up the row_count. Even at run time, it only
knows to send a string out to the DSQL processor: it doesn't validate
what's in the string, other than that it is a well-formed string.
Read the release notes regarding EXECUTE STATEMENT. Really, it's just a
useful hack. It's not the magic bullet you want it to be.
Please would you refrain from repeatedly subscribing and
unsubscribing? You cause unnecessary work for moderators, who are
volunteers, not public servants. If you want to stop getting email, go to
your settings on the list's main page and set your delivery option to "No
email". You'll still have posting rights.
^heLen