Page 1 of 1

execsql result count?

Posted: Fri 04 Mar 2011 16:13
by jdredd
Searched, but didn't find what i needed.. i'm sure tho it has to have been asked.. anyways..


I have an UPDATE query that runs. I need to know how many records it did if possible.

It looks like with ADO, that execsql has a return value.

Posted: Mon 07 Mar 2011 09:11
by AlexP
Hello,

To get the number of affected rows you can use the RowsAffected property like:

Code: Select all

  OraQuery1.SQL.Text := 'UPDATE T SET A = ''update'' WHERE B > 1';
  OraQuery1.Execute;
  ShowMessage('Affected Rows: '+IntToStr(OraQuery1.RowsAffected));

Posted: Mon 07 Mar 2011 15:48
by jdredd
awesome i will try that out!

Thanks a bunch.