ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/journaling/fbintf/client/FBStatement.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/FBStatement.pas (file contents):
Revision 345 by tony, Mon Aug 23 14:22:29 2021 UTC vs.
Revision 350 by tony, Wed Oct 20 14:58:56 2021 UTC

# Line 59 | Line 59 | type
59    protected
60      FTransactionIntf: ITransaction;
61      FExecTransactionIntf: ITransaction;
62 +    FStaleReferenceChecks: boolean;
63      FSQLStatementType: TIBSQLStatementTypes;         { Select, update, delete, insert, create, alter, etc...}
64      FSQLDialect: integer;
65      FOpen: boolean;
# Line 82 | Line 83 | type
83      procedure CheckHandle; virtual; abstract;
84      procedure CheckTransaction(aTransaction: ITransaction);
85      procedure GetDsqlInfo(info_request: byte; buffer: ISQLInfoResults); overload; virtual; abstract;
86 <    procedure InternalPrepare;  virtual; abstract;
86 >    procedure InternalPrepare(CursorName: AnsiString='');  virtual; abstract;
87      function InternalExecute(Transaction: ITransaction): IResults;  virtual; abstract;
88 <    function InternalOpenCursor(aTransaction: ITransaction): IResultSet;   virtual; abstract;
88 >    function InternalOpenCursor(aTransaction: ITransaction; Scrollable: boolean): IResultSet;   virtual; abstract;
89      procedure ProcessSQL(sql: AnsiString; GenerateParamNames: boolean; var processedSQL: AnsiString); virtual; abstract;
90      procedure FreeHandle;  virtual; abstract;
91      procedure InternalClose(Force: boolean); virtual; abstract;
# Line 113 | Line 114 | type
114      function GetSQLDialect: integer;
115  
116      {GetDSQLInfo only supports isc_info_sql_stmt_type, isc_info_sql_get_plan, isc_info_sql_records}
117 <    procedure Prepare(aTransaction: ITransaction=nil); virtual;
117 >    procedure Prepare(aTransaction: ITransaction=nil);  overload;
118 >    procedure Prepare(CursorName: AnsiString; aTransaction: ITransaction=nil); overload; virtual;
119      function Execute(aTransaction: ITransaction=nil): IResults;
120 <    function OpenCursor(aTransaction: ITransaction=nil): IResultSet;
120 >    function OpenCursor(aTransaction: ITransaction=nil): IResultSet; overload;
121 >    function OpenCursor(Scrollable: boolean; aTransaction: ITransaction=nil): IResultSet; overload;
122      function CreateBlob(paramName: AnsiString): IBlob; overload;
123      function CreateBlob(index: integer): IBlob; overload;
124      function CreateBlob(column: TColumnMetaData): IBlob; overload; virtual; abstract;
# Line 138 | Line 141 | type
141      function GetBatchCompletion: IBatchCompletion; virtual;
142      function GetBatchRowLimit: integer;
143      procedure SetBatchRowLimit(aLimit: integer);
144 +    {Stale Reference Check}
145 +    procedure SetStaleReferenceChecks(Enable:boolean); {default true}
146 +    function GetStaleReferenceChecks: boolean;
147    public
148      property ChangeSeqNo: integer read FChangeSeqNo;
149      property SQLParams: ISQLParams read GetSQLParams;
# Line 179 | Line 185 | begin
185    FSQLDialect := SQLDialect;
186    FSQL := sql;
187    FBatchRowLimit := DefaultBatchRowLimit;
188 +  FStaleReferenceChecks := true;
189   end;
190  
191   constructor TFBStatement.CreateWithParameterNames(Attachment: IAttachment;
# Line 294 | Line 301 | end;
301  
302   procedure TFBStatement.Prepare(aTransaction: ITransaction);
303   begin
304 +  Prepare('',aTransaction);
305 + end;
306 +
307 + procedure TFBStatement.Prepare(CursorName: AnsiString;
308 +  aTransaction: ITransaction);
309 + begin
310    if FPrepared then FreeHandle;
311    if aTransaction <> nil then
312    begin
# Line 301 | Line 314 | begin
314      FTransactionIntf := aTransaction;
315      AddMonitor(FTransactionIntf as TFBTransaction);
316    end;
317 <  InternalPrepare;
317 >  InternalPrepare(CursorName);
318   end;
319  
320   function TFBStatement.Execute(aTransaction: ITransaction): IResults;
# Line 344 | Line 357 | begin
357    FBatchRowLimit := aLimit;
358   end;
359  
360 + procedure TFBStatement.SetStaleReferenceChecks(Enable: boolean);
361 + begin
362 +  FStaleReferenceChecks := Enable;
363 + end;
364 +
365 + function TFBStatement.GetStaleReferenceChecks: boolean;
366 + begin
367 +  Result := FStaleReferenceChecks;
368 + end;
369 +
370   function TFBStatement.OpenCursor(aTransaction: ITransaction): IResultSet;
371   begin
372 +  Result := OpenCursor(false,aTransaction);
373 + end;
374 +
375 + function TFBStatement.OpenCursor(Scrollable: boolean; aTransaction: ITransaction
376 +  ): IResultSet;
377 + begin
378    Close;
379    if aTransaction = nil then
380 <    Result := InternalOpenCursor(FTransactionIntf)
380 >    Result := InternalOpenCursor(FTransactionIntf,Scrollable)
381    else
382 <    Result := InternalOpenCursor(aTransaction);
382 >    Result := InternalOpenCursor(aTransaction,Scrollable);
383   end;
384  
385   function TFBStatement.CreateBlob(paramName: AnsiString): IBlob;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines