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 118 by tony, Mon Jan 22 13:58:14 2018 UTC

# Line 56 | Line 56 | type
56      FPrepared: Boolean;
57      FParams: TParams;
58      FText: string;
59    FRowsAffected: Integer;
60    FCheckRowsAffected: Boolean;
59      FSQLUpdating: boolean;
60      FInQueryChanged: boolean;
61      function GetRowsAffected: Integer;
# Line 71 | Line 69 | type
69      procedure SetPrepared(Value: Boolean);
70      procedure SetPrepare(Value: Boolean);
71      procedure WriteParamData(Writer: TWriter);
72 <    function GetStmtHandle: TISC_STMT_HANDLE;
72 >    function GetStmtHandle: IStatement;
73      procedure UpdateSQL;
74  
75    protected
# Line 105 | Line 103 | type
103      procedure ResetParser; override;
104      property Prepared: Boolean read FPrepared write SetPrepare;
105      property ParamCount: Word read GetParamsCount;
106 <    property StmtHandle: TISC_STMT_HANDLE read GetStmtHandle;
106 >    property StmtHandle: IStatement read GetStmtHandle;
107      property StatementType;
108      property Text: string read FText;
109      property RowsAffected: Integer read GetRowsAffected;
# Line 137 | Line 135 | type
135      property TransactionFree;
136      property OnFilterRecord;
137      property OnValidatePost;
138 +    property OnDeleteReturning;
139   end;
140  
141   implementation
142  
143 + uses FBMessages;
144 +
145   { TIBQuery }
146  
147   constructor TIBQuery.Create(AOwner: TComponent);
# Line 150 | Line 151 | begin
151    TStringList(SQL).OnChange := QueryChanged;
152    FParams := TParams.Create(Self);
153    ParamCheck := True;
153  FRowsAffected := -1;
154   end;
155  
156   destructor TIBQuery.Destroy;
# Line 295 | Line 295 | begin
295    begin
296      if Value then
297      begin
298      FRowsAffected := -1;
299      FCheckRowsAffected := True;
298        if Length(Text) > 1 then PrepareSQL
299        else IBError(ibxeEmptySQLStatement, [nil]);
300      end
301      else
302      begin
305      if FCheckRowsAffected then
306        FRowsAffected := RowsAffected;
303        InternalUnPrepare;
304        FParams.Clear;
305      end;
# Line 376 | Line 372 | var
372   begin
373    CheckInActive;
374    if SQL.Count <= 0 then
379  begin
380    FCheckRowsAffected := False;
375      IBError(ibxeEmptySQLStatement, [nil]);
376 <  end;
376 >
377    ActivateConnection();
378    DidActivate := ActivateTransaction;
379    try
# Line 390 | Line 384 | begin
384    finally
385      if DidActivate then
386        DeactivateTransaction;
393    FCheckRowsAffected := True;
387    end;
388   end;
389  
# Line 399 | Line 392 | procedure TIBQuery.SetParams;
392   var
393   i : integer;
394   Buffer: Pointer;
395 < SQLParam: TIBXSQLVAR;
395 > SQLParam: ISQLParam;
396  
397   begin
398    for I := 0 to FParams.Count - 1 do
# Line 502 | Line 495 | begin
495          AddFieldToList(Params[i].Name, Self, DetailFields);
496   end;
497  
498 < function TIBQuery.GetStmtHandle: TISC_STMT_HANDLE;
498 > function TIBQuery.GetStmtHandle: IStatement;
499   begin
500    Result := SelectStmtHandle;
501   end;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines