EPUB | CHM | PDF

TMySQLBatchExecute.Events.OnProcessEx

Top Previous Next

note Since v2.6.0

OnProcessEx event fires when component need to execute current statement from SQL script executed by ExecSQL method.

Syntax:

property OnProcessEx: TMySQLBatchProcessExEvent;
type
TMySQLBatchProcessExEvent = procedure(Sender            : TObject;
                                      const SQLText     : String;
                                      StatementType     : TMySQLStatementType;
                                      const StatementNo : Integer;
                                      var Processed     : boolean) of object;
TMySQLStatementType = (mstCursor, mstNonCursor);

Description:

Use this event if you want to execute statement by user code with some custom processing. For example you can show resultset for cursor-returning query. Otherwise statement will be executed by component itself without any special processing.

note OnProcessEx event differs from OnBeforeStatement event. You can cancel statement execution at all in OnBeforeStatement event. OnProcessEx and OnAfterStatement events are not fired if you'll set Allow parameter of OnBeforeStatement event to False. And OnProcessEx event is just a way for some custom processing of executed statement.

Parameters:

Sender

Points to TMySQLBatchExecute component generated this error;

SQLText

SQL query statement text

StatementType

Type of current statement. Possible values are:

mstCursor - Statement that return some resultset. This are SELECT, EXPLAIN, SHOW and DESCRIBE statements for now.
mstNonCursor - All other statements.

StatementNo

The number of the SQL statement in SQL script

Processed

Set this parameter value to True if you don't want for component execute statement by itself. For example if you've executed it by yourself in event handler.

See also: OnBeforeStatement and OnAfterStatement events