52 |
|
TFBStatement = class(TActivityReporter) |
53 |
|
private |
54 |
|
FAttachmentIntf: IAttachment; |
55 |
+ |
FFirebirdClientAPI: TFBClientAPI; |
56 |
|
protected |
57 |
|
FTransactionIntf: ITransaction; |
58 |
|
FExecTransactionIntf: ITransaction; |
79 |
|
procedure InternalPrepare; virtual; abstract; |
80 |
|
function InternalExecute(aTransaction: ITransaction): IResults; virtual; abstract; |
81 |
|
function InternalOpenCursor(aTransaction: ITransaction): IResultSet; virtual; abstract; |
82 |
+ |
procedure ProcessSQL(sql: AnsiString; GenerateParamNames: boolean; var processedSQL: AnsiString); virtual; abstract; |
83 |
|
procedure FreeHandle; virtual; abstract; |
84 |
|
procedure InternalClose(Force: boolean); virtual; abstract; |
85 |
|
function TimeStampToMSecs(const TimeStamp: TTimeStamp): Int64; |
92 |
|
procedure Close; |
93 |
|
procedure TransactionEnding(aTransaction: ITransaction; Force: boolean); |
94 |
|
property SQLDialect: integer read FSQLDialect; |
95 |
+ |
property FirebirdClientAPI: TFBClientAPI read FFirebirdClientAPI; |
96 |
|
|
97 |
|
public |
98 |
|
function GetSQLParams: ISQLParams; virtual; abstract; |
101 |
|
DeleteCount: integer): boolean; |
102 |
|
function GetSQLStatementType: TIBSQLStatementTypes; |
103 |
|
function GetSQLText: AnsiString; |
104 |
+ |
function GetProcessedSQLText: AnsiString; |
105 |
|
function GetSQLDialect: integer; |
106 |
|
|
107 |
|
{GetDSQLInfo only supports isc_info_sql_stmt_type, isc_info_sql_get_plan, isc_info_sql_records} |
151 |
|
inherited Create(Transaction as TFBTransaction,2); |
152 |
|
FAttachmentIntf := Attachment; |
153 |
|
FTransactionIntf := Transaction; |
154 |
+ |
FFirebirdClientAPI := Attachment.getFirebirdAPI as TFBClientAPI; |
155 |
|
FSQLDialect := SQLDialect; |
156 |
|
FSQL := sql; |
157 |
|
end; |
233 |
|
Result := FSQL; |
234 |
|
end; |
235 |
|
|
236 |
+ |
function TFBStatement.GetProcessedSQLText: AnsiString; |
237 |
+ |
begin |
238 |
+ |
if FProcessedSQL = '' then |
239 |
+ |
ProcessSQL(FSQL,FGenerateParamNames,FProcessedSQL); |
240 |
+ |
Result := FProcessedSQL |
241 |
+ |
end; |
242 |
+ |
|
243 |
|
function TFBStatement.GetSQLDialect: integer; |
244 |
|
begin |
245 |
|
Result := FSQLDialect; |
318 |
|
|
319 |
|
function TFBStatement.GetDSQLInfo(Request: byte): ISQLInfoResults; |
320 |
|
begin |
321 |
< |
Result := TSQLInfoResultsBuffer.Create; |
321 |
> |
Result := TSQLInfoResultsBuffer.Create(FFirebirdClientAPI); |
322 |
|
GetDsqlInfo(Request,Result); |
323 |
|
end; |
324 |
|
|