mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 12:32:55 +02:00
* Added AutoCommit featuresqlscript.pp
git-svn-id: trunk@13369 -
This commit is contained in:
parent
173a0647a3
commit
a01d93dda0
@ -32,6 +32,7 @@ type
|
||||
|
||||
TCustomSQLScript = class(TComponent)
|
||||
private
|
||||
FAutoCommit: Boolean;
|
||||
FLine: Integer;
|
||||
FCol: Integer;
|
||||
FDefines: TStrings;
|
||||
@ -75,6 +76,7 @@ type
|
||||
protected
|
||||
property Aborted: Boolean read FAborted;
|
||||
property Line: Integer read GetLine;
|
||||
Property AutoCommit : Boolean Read FAutoCommit Write FAutoCommit;
|
||||
property CommentsInSQL: Boolean read FCommentsInSQL write FCommentsInSQL;
|
||||
property UseSetTerm: Boolean read FUseSetTerm write FUseSetTerm;
|
||||
property UseCommit: Boolean read FUseCommit write FUseCommit;
|
||||
@ -401,7 +403,8 @@ begin
|
||||
end
|
||||
else If Not FIsSkipping then
|
||||
begin
|
||||
if FUseCommit and (Directive = 'COMMIT') then
|
||||
// If AutoCommit, skip any explicit commits.
|
||||
if FUseCommit and (Directive = 'COMMIT') and not FAutoCommit then
|
||||
InternalCommit
|
||||
else if FUseSetTerm and (Directive = 'SET TERM') then
|
||||
FTerminator:=S
|
||||
@ -411,7 +414,11 @@ begin
|
||||
end
|
||||
else
|
||||
if (not FIsSkipping) then
|
||||
begin
|
||||
InternalStatement(FCurrentStatement,FAborted);
|
||||
If FAutoCommit and not FAborted then
|
||||
InternalCommit;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomSQLScript.Execute;
|
||||
|
Loading…
Reference in New Issue
Block a user