execsql result count?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

execsql result count?

Post by jdredd » Fri 04 Mar 2011 16:13

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 07 Mar 2011 09:11

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));

jdredd
Posts: 42
Joined: Wed 25 Mar 2009 21:14

Post by jdredd » Mon 07 Mar 2011 15:48

awesome i will try that out!

Thanks a bunch.

Post Reply