Skip to content

TSQLScript

Component to execute various SQL statements.

Declaration

Source position: sqldb.pp line 741

type

  TSQLScript = class(TCustomSQLscript)
  public
    constructor Create;
    destructor Destroy;
    procedure Execute;
    procedure ExecuteScript;
    property Aborted;
    property Line;
  published
    property DataBase: TDatabase; {rw}
    property Transaction: TDBTransaction; {rw}
    property OnDirective: TSQLScriptDirectiveEvent; {rw}
    property AutoCommit;
    property UseDollarString;
    property DollarStrings;
    property Directives;
    property Defines;
    property Script;
    property Terminator;
    property CommentsinSQL;
    property UseSetTerm;
    property UseCommit;
    property UseDefines;
    property OnException;
  end;

Inheritance

Description

TSQLScript is a component that can be used to execute many SQL statements using a TSQLQuery component. The SQL statements are specified in a script TSQLScript.Script separated by a terminator character (typically a semicolon (;)).

Properties

Member Visibility Description
Aborted read only public True when the script was aborted.
AutoCommit read only published Automatically commit every statement.
CommentsinSQL read only published Should comments be passed to the SQL engine ?
DataBase published Database on which to execute the script.
Defines read only published Defined macros.
Directives read only published List of directives.
DollarStrings read only published List of alternate string delimiter token sequences.
Line read only public Current line of execution in the script.
Script read only published The script to execute.
Terminator read only published Terminator character.
Transaction published Transaction to use in the script.
UseCommit read only published Control automatic handling of the COMMIT command.
UseDefines read only published Automatically handle pre-processor defines.
UseDollarString read only published Enable support for dollarstrings.
UseSetTerm read only published Should the SET TERM directive be recognized.

Methods

Member Visibility Description
Create public Create a new TSQLScript instance.
Destroy public Remove the TSQLScript instance from memory.
Execute public Execute the script.
ExecuteScript public Convenience function, simply calls Execute.

Events

Member Visibility Description
OnDirective published Event handler if a directive is encountered.
OnException read only published Exception handling event.

See also

Name Description
TSQLTransaction Transaction in which a TSQLQuery is handled.
TSQLConnection An abstract class representing a connection to a SQL Database.
TCustomSQLQuery.ExecSQL Execute a SQL statement that does not return a result set.
TSQLQuery.SQL The SQL statement to execute.