RX SQL Scripts

RX Library

Control Name Unit Class
RX SQL Scripts RxQuery TSQLScript

Description:
RxSql Scripts is an enhanced version of the SQL.


Property SemicolonTerm
Declaration: SemicolonTerm: Boolean;

Property SemiColon allows the term SemiColon to be input into the SQL statement.


Property SQL
Declaration: SQL: TStrings;

Property SQL example:
The following examples show SQL statements used with TSQLScript component:

UPDATE NEXTITEM SET NewItem = 1098;
UPDATE NEXTORDER SET NewItem = 1099;

or UPDATE NEXTITEM SET NewItem = 1098 /
UPDATE NEXTORD SET NewOrder = 1099

or UPDATE NEXTITEM SET NewItem = 1098; /
UPDATE NEXTORD SET NewOrder = 1099;

UPDATE NEXTCUST SET NewCustomer = 1034;


Property Transaction
Declaration: Transaction: Boolean;

Property Transaction defines whether the action should be defined as a transaction.


Event AfterExec
Declaration: AfterExec: TNotifyEvent;

After execution of the SQL, event EventAfterExec is triggered.


Event BeforeExec
Declaration: BeforeExec: TNotifyEvent;

Before execution of the SQL, event EventBeforeExec is triggered.


Event OnScriptError
Declaration: OnScriptError: TScriptErrorEvent;

The OnScriptError event occurs when there was an error during execution of a single SQL statement from SQL script. The Sender parameter is the TSQLScript component that had the problem. The E parameter is an EDatabaseError exception object that contains details about the problem.

The LineNo parameter is a number of line in the script, and StatementNo is a sequence number of single SQL statement that caused the error. Action is a var parameter that lets you control how the error is handled when the event handler finishes.


Method ExecStatement
Declaration: procedure ExecStatement(StatementNo: Integer);

Executes a single SQL-statement specified by StatementNo parameter.


Const DefaultMacroChar
Declaration: DefaultMacroChar = '%';;

Specifies default value for the MacroChar property of the TRxQuery component.


Const DefaultTermChar
Declaration: DefaultTermChar = '/';;

Specifies default value for the Term property of the TSQLScript component.


Type TQueryOpenStatus
Declaration: TQueryOpenStatus = (qsOpened, qsExecuted, qsFailed);

The TQueryOpenStatus type is the type of the OpenStatus property for a TRxQuery component.


Type TScriptAction
Declaration: TScriptAction = (saFail, saAbort, saRetry, saIgnore, saContinue);

The TScriptAction type defines the possible values you can assign to the Action parameter in the OnScriptError event of the TSQLScript component, as described below:

  • saFail - (The default value of Action.) The error is reported as an exception, as it normally would be.
  • saAbort - The error is discarded by raising a "silent" EAbort exception.
  • saRetry - The application goes into a loop, repeating the execution of current (last executed) SQL-statement until it succeeds or you assign Action another value.
  • saIgnore - The error is discarded, and sript execution continue from next statement.
  • saContinue - The error is reported as a dialog box (using Application.HandleException method), and sript execution continue from next statement.

Type TScriptErrorEvent
Declaration: TScriptErrorEvent = procedure(Sender: TObject; E: EDatabaseError; LineNo, StatementNo: Integer; var Action: TScriptAction) of object;

TScriptErrorEvent defines the type of the OnScriptError event handler.


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000