35 |
|
|
36 |
|
{$Mode Delphi} |
37 |
|
|
38 |
+ |
{$codepage UTF8} |
39 |
+ |
|
40 |
|
interface |
41 |
|
|
42 |
|
uses SysUtils, Classes, DB, IB, IBCustomDataSet, |
182 |
|
|
183 |
|
implementation |
184 |
|
|
185 |
+ |
uses FBMessages; |
186 |
+ |
|
187 |
|
{ TIBTable } |
188 |
|
|
189 |
|
constructor TIBTable.Create(AOwner: TComponent); |
330 |
|
end; |
331 |
|
end; |
332 |
|
Query.Prepare; |
333 |
+ |
FieldDefsFromQuery(Query); |
334 |
|
if DidActivate then |
335 |
|
Query.Transaction.Rollback; |
331 |
– |
FieldDefsFromQuery(Query); |
336 |
|
finally |
337 |
|
Query.Free; |
338 |
|
end; |
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; |
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 |
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; |
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; |
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; |