Subject Re: [firebird-support] ROW_COUNT
Author Daniel Rail
Hi,

At January 21, 2004, 01:49, Helen Borrie wrote:

> Dunno about "standard" but Dmitry's notes are pretty specific about the
> context.

Here's what the SQL-99 standard says:

[Start quote]
e) The value of ROW_COUNT is the number of rows affected as the result
of executing a <delete statement: searched>, <insert statement>, or
<update statement: searched> or as a direct result of executing the
previous SQL-statement. Let S be the <delete statement: searched>,
<insert statement>, or <update statement: searched>. Let T be the
table identified by the <table name> directly contained in S.

Case:

i) If S is an <insert statement>, then the value of ROW_COUNT is the
number of rows inserted into T.

ii) If S is not an <insert statement> and does not contain a <search
condition>, then the value of ROW_COUNT is the cardinality of T before
the execution of S.

iii) Otherwise, let SC be the <search condition> directly contained in
S. The value of ROW_ COUNT is effectively derived by executing the
statement:

SELECT COUNT(*) FROM T WHERE SC

before the execution of S.

The value of ROW_COUNT following the execution of an SQL-statement
that does not directly result in the execution of a <delete statement:
searched>, an <insert statement>, or an <update statement: searched>
is implementation-dependent.
[End quote]


--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)