Professional Documents
Culture Documents
Properties
property Finished: Boolean True when there is nothing left to parse.
property Paused: Boolean Whether or not the parser is paused or not.
property Script: TStrings The script to parse.
property Terminator: string Current terminator for the script. Default to ;. The
Terminator remains the same as it was at the end of the previous parsing so if you
do a set term ^; and never set it back to ; the terminator remains ^ on the next
script parsing.
property OnParse: TIBSQLParseStmt Event that passes the SQL type and the
SQL statement out of the parser.
TIBSQLParseStmt = procedure(Sender: TObject; AKind: TIBParseKind;
SQLText: string) of object;
TIBParseKind
stmtDDL DDL statement.
stmtDML DML Statement.
stmtSET SET statement (note the SET is stripped).
stmtCONNECT Connect statement.
stmtDrop Drop Database statement.
stmtCREATE Create Database statement.
stmtINPUT Input from another file statement.
stmtUNK Unknown. The parser could not determine the
statement type.
stmtEMPTY Empty statement. (Never returned in a OnParse
event)
stmtTERM Set TERM statement. Only the terminator is passed.
stmtERR Error state. It is rare that the parser can continue after
this.
stmtCOMMIT Commit statement.
stmtROLLBACK Rollback statement.
property OnError: TIBSQLParseError Event fired when there is a parser error.
Continuation after an error is rare.
TIBSQLParseError = procedure(Sender: TObject; Error: string; SQLText: string;
LineIndex: Integer) of object;
IBScript This will run and execute a valid SQL script. It allows for retrieving of
parameters for parameterized SQL statements.
Procedures
function ValidateScript: Boolean Parses but does not execute the script. Returns
true if it parses without error, false otherwise.
procedure ExecuteScript Actually executes the script.
function ParamByName(Idx : String) : TIBXSQLVAR Allows for the setting of
parameters when the execution is paused to get parameters (see OnParamCheck
event).
Properties
Public
property Paused: Boolean Whether or not the Script is paused during its
execution.
property Params: TIBXSQLDA Retrieves the IBXSQLDA structure for setting
parameters.
property Stats : TIBScriptStats When stats are on (default) gets at the stats for
the most recently run script. Stats should be paused every time the Script is
paused.
Published
property AutoDDL: Boolean default true Whether or not DDL statements
should be commited automatically. When true DDL is executed in a separate
transaction than the DML statements.
property Dataset: TIBDataset When a Dataset is attached then the DML is run
through that Dataset. It allows for things like scripting multiple statemetns that
ends with a select statement and you have an open result set at the end.
property Database: TIBDatabase The database to use for the script.
property Transaction: TIBTransaction The transaction to use for DML and DDL
(Auto DDL false) statements.
property Terminator: string Current terminator for the Script. Defaults to ;, but
retains the last set terminator on multiple runs.
property Script: TStrings The actual script.
property Statistics: boolean default true Whether or not stats should be kept for
the executing script. Stats can be read from the public Stats property after
execution.
TIBScriptStats See IBDatabaseInfo for the meaning of the properties.
property Buffers
property Reads
property Writes
property SeqReads
property Fetches
property ReadIdx
property DeltaMem
property StartingMem
property OnParse: TIBSQLParseStmt Output of the most recently executed
Script statement (see IBSQLParser OnParseStmt).
property OnParseError: TIBSQLParseError Fires when there is a parsing
problem and the Scriptor cant figure out how to execute the statement. (see
IBSQLParser OnParseError)
property OnExecuteError: TIBSQLExecuteError Fires when there is an error
state returned from the server. Allows for continuation by setting ignore to true
9ignore defaults to false).
TIBSQLExecuteError = procedure(Sender: TObject; Error: string;
SQLText : string; LineIndex: Integer; var Ignore: Boolean) of object;
property OnParamCheck: TIBScriptParamCheck Fires when a DML statement
is determined to have parameters. Either set the param in the event or set Pause to
true and stop the execution at that point so you can setup the params and then set
Paused to false to continue execution (this feature has be tested the least). Access
the Params through ParamByName or the Params property.
TIBScriptParamCheck = procedure(Sender: TIBScript; var Pause:
Boolean) of object;
IBFilterDialog This allows you to have the end user modify (filter) the result set. Its
interface is similar to Woll2Wolls FilterDialog component (their code was not referenced
at all when this was first written over 4 years ago by me for Direct Oracle Access not
during the port to IBX). This is currently a VCL only component and can not be used in
Clx applications. This works by modifying the where clause and re executing the SQL so
be careful using this when in cached update mode due to the potential loss of cached data
when the SQL is re executed.
Procedures
procedure Execute Bring up the dialog for display.
procedure ReBuildSQL Rebuild the SQL based on the new params.
Properties
Public
property ModifiedSQL Returns the SQL generated based on the new input.
Published
property Caption : String Caption for the Dialog
property DataSet : TIBCustomDataset The Dataset to alter (IBDataset or
IBQuery acceptable).
property DefaultMatchType : TIBFilterMatchType default fdMatchStart The
default setting for how string filters should be done.
TIBFilterMatchType
fdMatchExact Does a straight = string
fdMatchStart Does a starting with string
fdMatchEnd Does a = %string
fdMatchAny Does a = %string%
fdMatchRange if only starting then >= value, if only ending then
<= value and if both then it has to be between the two.
fdMatchNone prepends with a not.
property Options : TIBOptions read FOptions write SetOptions default
[fdShowCaseSensitive, fdShowNonMatching];
TIBOptions = Set of TIBOption;
TIBOption =
fdCaseSensitive Leaves the string exactly as type when checked,
upper cases it when unchecked (default)
fdShowCaseSensitive whether or not the case sensitive check
box should be shown.
fdShowNonMatching Whether or not the Not Matching check
box should be shown.
property Fields : TStringList Allows you to restrict what fields will be shown in
the dialog.