3. Statements : OpenROAD SQL Statements : Set Statement : Update_Rowcount
 
Share this page                  
Update_Rowcount
The set update_rowcount statement specifies the nature of the value returned by the inquire_sql(rowcount) statement.
Valid options are:
changed
Returns the number of rows changed by the last query.
qualified
(Default) Returns the number of rows that qualified for change by the last query.
For example, consider the following table called test_table:
column1
column2
column3
Jones
000
green
Smith
000
green
Smith
000
green
and the following query is executed:
update test_table set column1 = 'Jones'
        where column2 = 000 and column3 = 'green';
The DBMS Server, for reasons of efficiency, does not actually update the first row because column1 already contains "Jones". However, the row does qualify for updating by the query.
If the update_rowcount option is set to changed, inquire_sql(rowcount) returns 2 (the number of rows actually changed).
If the update_rowcount option is set to qualified, inquire_sql(rowcount) returns 3 (the number of rows that qualified to be changed).
To determine the setting for the update_rowcount option, issue the following statement:
select dbmsinfo('update_rowcnt')