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

Comparing ibx/trunk/runtime/IBTable.pas (file contents):
Revision 44 by tony, Tue May 17 08:14:52 2016 UTC vs.
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC

# Line 35 | Line 35 | unit IBTable;
35  
36   {$Mode Delphi}
37  
38 {$IF FPC_FULLVERSION >= 20700 }
38   {$codepage UTF8}
40 {$ENDIF}
39  
40   interface
41  
# Line 184 | Line 182 | type
182  
183   implementation
184  
185 + uses FBMessages;
186 +
187   { TIBTable }
188  
189   constructor TIBTable.Create(AOwner: TComponent);
# Line 330 | Line 330 | begin
330                end;
331           end;
332           Query.Prepare;
333 +         FieldDefsFromQuery(Query);
334           if DidActivate then
335              Query.Transaction.Rollback;
335         FieldDefsFromQuery(Query);
336      finally
337           Query.Free;
338      end;
# Line 483 | Line 483 | var
483          Query.SQL.Text := 'Alter Table ' +  {do not localize}
484            QuoteIdentifier(DataBase.SQLDialect, FTableName) +
485            ' Drop Constraint ' +
486 <          QuoteIdentifier(DataBase.SQLDialect, Query.Current.ByName('RDB$CONSTRAINT_NAME').AsString);
486 >          QuoteIdentifier(DataBase.SQLDialect, Query.FieldByName('RDB$CONSTRAINT_NAME').AsString);
487          Query.Prepare;
488          Query.ExecQuery;
489          IndexDefs.Updated := False;
# Line 591 | Line 591 | begin
591         QuoteIdentifier(DataBase.SQLDialect, FTableName)) + '''';
592      Query.Prepare;
593      Query.ExecQuery;
594 <    while (not Query.EOF) and (Query.Next <> nil) do
594 >    while (not Query.EOF) and Query.Next do
595      begin
596        with IndexDefs.AddIndexDef do
597        begin
598 <        Name := TrimRight(Query.Current.ByName('RDB$INDEX_NAME').AsString); {do not localize}
598 >        Name := TrimRight(Query.FieldByName('RDB$INDEX_NAME').AsString); {do not localize}
599          Opts := [];
600          if Pos ('RDB$PRIMARY', Name) = 1 then Include(Opts, ixPrimary); {do not localize} {mbcs ok}
601 <        if Query.Current.ByName('RDB$UNIQUE_FLAG').AsInteger = 1 then Include(Opts, ixUnique); {do not localize}
602 <        if Query.Current.ByName('RDB$INDEX_TYPE').AsInteger = 2  then Include(Opts, ixDescending); {do not localize}
601 >        if Query.FieldByName('RDB$UNIQUE_FLAG').AsInteger = 1 then Include(Opts, ixUnique); {do not localize}
602 >        if Query.FieldByName('RDB$INDEX_TYPE').AsInteger = 2  then Include(Opts, ixDescending); {do not localize}
603          Options := Opts;
604 <        if (Query.Current.ByName('RDB$SEGMENT_COUNT').AsInteger = 1) then {do not localize}
604 >        if (Query.FieldByName('RDB$SEGMENT_COUNT').AsInteger = 1) then {do not localize}
605          begin
606 <          fn := Trim(Query.Current.ByName('RDB$FIELD_NAME').AsString); {do not localize}
606 >          fn := Trim(Query.FieldByName('RDB$FIELD_NAME').AsString); {do not localize}
607            aField := GetFieldDefFromAlias(fn);
608            if assigned(aField) then
609               Fields := aField.Name
# Line 625 | Line 625 | begin
625            SubQuery.Prepare;
626            SubQuery.ExecQuery;
627            Flds := '';
628 <          while (not SubQuery.EOF) and (SubQuery.Next <> nil) do
628 >          while (not SubQuery.EOF) and SubQuery.Next do
629            begin
630 <            fn := TrimRight(SubQuery.Current.ByName('RDB$FIELD_NAME').AsString); {do not localize}
630 >            fn := TrimRight(SubQuery.FieldByName('RDB$FIELD_NAME').AsString); {do not localize}
631              aField := GetFieldDefFromAlias(fn);
632              if assigned(aField) then
633                 fn := aField.Name;
# Line 921 | Line 921 | begin
921                        QuoteIdentifier(DataBase.SQLDialect, FTableName)) + '''';
922      Query.Prepare;
923      Query.ExecQuery;
924 <    if (Query.Current[0].AsInteger <> 0) or
925 <       (Query.Current[1].AsInteger <> 8) then
924 >    if (Query.Fields[0].AsInteger <> 0) or
925 >       (Query.Fields[1].AsInteger <> 8) then
926        Result := False
927      else
928        Result := True;
# Line 1205 | Line 1205 | begin
1205                            ' where RDB$VIEW_BLR is NULL and RDB$SYSTEM_FLAG = 0'; {do not localize}
1206        Query.Prepare;
1207        Query.ExecQuery;
1208 <      while (not Query.EOF) and (Query.Next <> nil) do
1209 <        FNameList.Add (TrimRight(Query.Current[0].AsString));
1208 >      while (not Query.EOF) and Query.Next  do
1209 >        FNameList.Add (TrimRight(Query.Fields[0].AsString));
1210      finally
1211        Query.Free;
1212        Database.InternalTransaction.Commit;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines