1

How can you get the rows affected by an SQL UPDATE statement in INGRES?

eg: SELECT COUNT (*) FROM ( UPDATE gare SET code_gare = 'AB-BV' WHERE code_gare = 'AB' )

RESULT count = 2 (something like this)

Thulasi
  • 23
  • 6

1 Answers1

1

Ingres can distinguish rows actually updated from rows that satisfied the WHERE clause. Depending on the system configuration one or the other will be reported, so you need to know the local setting. Applications can override the system configuration by executing the SET UPDATE_ROWCOUNT CHANGED | QUALIFIED statement.

The row count is returned in the SQLCA if you are using embedded SQL in a host 3GL, or you can obtain it using the embedded INQUIRE_SQL ( :n=rowcount ) statement. In other languages/APIs the row count will be returned in the locally appropriate way. (For more detail please indicate your language.)

Roy
  • 51
  • 5