ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBQuery.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBQuery.pas (file contents):
Revision 39 by tony, Tue May 17 08:14:52 2016 UTC vs.
Revision 143 by tony, Fri Feb 23 12:11:21 2018 UTC

# Line 27 | Line 27
27   {    IBX For Lazarus (Firebird Express)                                  }
28   {    Contributor: Tony Whyman, MWA Software http://www.mwasoftware.co.uk }
29   {    Portions created by MWA Software are copyright McCallum Whyman      }
30 < {    Associates Ltd 2011                                                 }
30 > {    Associates Ltd 2011 - 2018                                               }
31   {                                                                        }
32   {************************************************************************}
33  
# Line 43 | Line 43 | uses
43   {$ELSE}
44    unix,
45   {$ENDIF}
46 < SysUtils, Classes,  Db,
47 <     IBHeader, IB, IBCustomDataSet, IBSQL, IBSQLParser;
46 > SysUtils, Classes,  Db, IB, IBCustomDataSet, IBSQL;
47  
48   type
49  
# Line 56 | Line 55 | type
55      FPrepared: Boolean;
56      FParams: TParams;
57      FText: string;
59    FRowsAffected: Integer;
60    FCheckRowsAffected: Boolean;
58      FSQLUpdating: boolean;
59      FInQueryChanged: boolean;
60      function GetRowsAffected: Integer;
# Line 71 | Line 68 | type
68      procedure SetPrepared(Value: Boolean);
69      procedure SetPrepare(Value: Boolean);
70      procedure WriteParamData(Writer: TWriter);
71 <    function GetStmtHandle: TISC_STMT_HANDLE;
71 >    function GetStmtHandle: IStatement;
72      procedure UpdateSQL;
73  
74    protected
# Line 105 | Line 102 | type
102      procedure ResetParser; override;
103      property Prepared: Boolean read FPrepared write SetPrepare;
104      property ParamCount: Word read GetParamsCount;
105 <    property StmtHandle: TISC_STMT_HANDLE read GetStmtHandle;
105 >    property StmtHandle: IStatement read GetStmtHandle;
106      property StatementType;
107      property Text: string read FText;
108      property RowsAffected: Integer read GetRowsAffected;
# Line 137 | Line 134 | type
134      property TransactionFree;
135      property OnFilterRecord;
136      property OnValidatePost;
137 +    property OnDeleteReturning;
138   end;
139  
140   implementation
141  
142 + uses FBMessages;
143 +
144   { TIBQuery }
145  
146   constructor TIBQuery.Create(AOwner: TComponent);
# Line 150 | Line 150 | begin
150    TStringList(SQL).OnChange := QueryChanged;
151    FParams := TParams.Create(Self);
152    ParamCheck := True;
153  FRowsAffected := -1;
153   end;
154  
155   destructor TIBQuery.Destroy;
# Line 295 | Line 294 | begin
294    begin
295      if Value then
296      begin
298      FRowsAffected := -1;
299      FCheckRowsAffected := True;
297        if Length(Text) > 1 then PrepareSQL
298        else IBError(ibxeEmptySQLStatement, [nil]);
299      end
300      else
301      begin
305      if FCheckRowsAffected then
306        FRowsAffected := RowsAffected;
302        InternalUnPrepare;
303        FParams.Clear;
304      end;
# Line 376 | Line 371 | var
371   begin
372    CheckInActive;
373    if SQL.Count <= 0 then
379  begin
380    FCheckRowsAffected := False;
374      IBError(ibxeEmptySQLStatement, [nil]);
375 <  end;
375 >
376    ActivateConnection();
377    DidActivate := ActivateTransaction;
378    try
# Line 390 | Line 383 | begin
383    finally
384      if DidActivate then
385        DeactivateTransaction;
393    FCheckRowsAffected := True;
386    end;
387   end;
388  
# Line 399 | Line 391 | procedure TIBQuery.SetParams;
391   var
392   i : integer;
393   Buffer: Pointer;
394 < SQLParam: TIBXSQLVAR;
394 > SQLParam: ISQLParam;
395  
396   begin
397    for I := 0 to FParams.Count - 1 do
# Line 502 | Line 494 | begin
494          AddFieldToList(Params[i].Name, Self, DetailFields);
495   end;
496  
497 < function TIBQuery.GetStmtHandle: TISC_STMT_HANDLE;
497 > function TIBQuery.GetStmtHandle: IStatement;
498   begin
499    Result := SelectStmtHandle;
500   end;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines