* Added AutoCommit featuresqlscript.pp

git-svn-id: trunk@13369 -
This commit is contained in:
michael 2009-07-08 09:05:55 +00:00
parent 173a0647a3
commit a01d93dda0

View File

@ -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;