HOW TO OBTAIN ROWSAFFECTED

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
User avatar
M56OBER
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 28.10.2005, 12:33
Location: FRANCE

HOW TO OBTAIN ROWSAFFECTED

Postby M56OBER » 19.09.2016, 15:28

Hi,

I want to obtain the rowaffected value in ZSQLProcessor, have you a solution?

BR
Olivier

marsupilami
Gold Boarder
Gold Boarder
Posts: 589
Joined: 17.01.2011, 14:17

Re: HOW TO OBTAIN ROWSAFFECTED

Postby marsupilami » 19.09.2016, 16:00

Hello Oliver,

it doesn't make sense to have a rows-affected-property for TZSQLProcessor because every statement in the script can affect a different number of rows. If you need the affected rows for a statement, I suggest to break down your script into single statements and check wether it is possible to get the count of affected rows from TZQuery.

With best regards,

Jan

User avatar
M56OBER
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 28.10.2005, 12:33
Location: FRANCE

Re: HOW TO OBTAIN ROWSAFFECTED

Postby M56OBER » 21.09.2016, 13:41

Thank you for your answer.
But I want to build a track of the script. I want to obtain the number of rowaffected for each request of the script Sqlprocessor.
On the event afterExcute for example

ZSQLProcessor1AfterExecute(Processor: TZSQLProcessor;
StatementIndex: Integer);


Olivier

marsupilami
Gold Boarder
Gold Boarder
Posts: 589
Joined: 17.01.2011, 14:17

Re: HOW TO OBTAIN ROWSAFFECTED

Postby marsupilami » 26.09.2016, 15:28

Hello Olivier,

hmm - in that case you might need to modify the TZSQLProcessor component to deliver the required information. Maybe having a look at TZQuery might help because I seem to remember that TZQuery can already return the modified rows count. If TZQuery can't help, there is an exception somewhere that uses this functionality.
If you want to take a dive into the code and need some help, löet me know. Unfortunately time is tight on me so I can't implement this fature currently.

With best regards,

Jan

User avatar
M56OBER
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 28.10.2005, 12:33
Location: FRANCE

Re: HOW TO OBTAIN ROWSAFFECTED

Postby M56OBER » 27.09.2016, 07:29

Hi

Indeed TZquery can turn the value RowsAffected,
so I am going to cut the script, to obtain my answer

Thank you
Olivier


Return to “ZeosLib 7.1 stable Forum”

Who is online

Users browsing this forum: No registered users and 1 guest