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; |
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; |
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; |
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; |
185 |
|
FSQLDialect := SQLDialect; |
186 |
|
FSQL := sql; |
187 |
|
FBatchRowLimit := DefaultBatchRowLimit; |
188 |
+ |
FStaleReferenceChecks := true; |
189 |
|
end; |
190 |
|
|
191 |
|
constructor TFBStatement.CreateWithParameterNames(Attachment: IAttachment; |
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 |
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; |
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; |