mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 14:50:38 +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)
|
TCustomSQLScript = class(TComponent)
|
||||||
private
|
private
|
||||||
|
FAutoCommit: Boolean;
|
||||||
FLine: Integer;
|
FLine: Integer;
|
||||||
FCol: Integer;
|
FCol: Integer;
|
||||||
FDefines: TStrings;
|
FDefines: TStrings;
|
||||||
@ -75,6 +76,7 @@ type
|
|||||||
protected
|
protected
|
||||||
property Aborted: Boolean read FAborted;
|
property Aborted: Boolean read FAborted;
|
||||||
property Line: Integer read GetLine;
|
property Line: Integer read GetLine;
|
||||||
|
Property AutoCommit : Boolean Read FAutoCommit Write FAutoCommit;
|
||||||
property CommentsInSQL: Boolean read FCommentsInSQL write FCommentsInSQL;
|
property CommentsInSQL: Boolean read FCommentsInSQL write FCommentsInSQL;
|
||||||
property UseSetTerm: Boolean read FUseSetTerm write FUseSetTerm;
|
property UseSetTerm: Boolean read FUseSetTerm write FUseSetTerm;
|
||||||
property UseCommit: Boolean read FUseCommit write FUseCommit;
|
property UseCommit: Boolean read FUseCommit write FUseCommit;
|
||||||
@ -401,7 +403,8 @@ begin
|
|||||||
end
|
end
|
||||||
else If Not FIsSkipping then
|
else If Not FIsSkipping then
|
||||||
begin
|
begin
|
||||||
if FUseCommit and (Directive = 'COMMIT') then
|
// If AutoCommit, skip any explicit commits.
|
||||||
|
if FUseCommit and (Directive = 'COMMIT') and not FAutoCommit then
|
||||||
InternalCommit
|
InternalCommit
|
||||||
else if FUseSetTerm and (Directive = 'SET TERM') then
|
else if FUseSetTerm and (Directive = 'SET TERM') then
|
||||||
FTerminator:=S
|
FTerminator:=S
|
||||||
@ -411,7 +414,11 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (not FIsSkipping) then
|
if (not FIsSkipping) then
|
||||||
|
begin
|
||||||
InternalStatement(FCurrentStatement,FAborted);
|
InternalStatement(FCurrentStatement,FAborted);
|
||||||
|
If FAutoCommit and not FAborted then
|
||||||
|
InternalCommit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSQLScript.Execute;
|
procedure TCustomSQLScript.Execute;
|
||||||
|
Loading…
Reference in New Issue
Block a user