HOW TO OBTAIN ROWSAFFECTED

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

HOW TO OBTAIN ROWSAFFECTED

Post by M56OBER »

Hi,

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

BR
Olivier
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: HOW TO OBTAIN ROWSAFFECTED

Post by marsupilami »

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

Post by M56OBER »

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
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: HOW TO OBTAIN ROWSAFFECTED

Post by marsupilami »

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

Post by M56OBER »

Hi

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

Thank you
Olivier
Post Reply