Equivalent of BDE TTable IndexName property?
Equivalent of BDE TTable IndexName property?
For TUniTable (Interbase provider), what is the equivalent property for BDE TTable IndexName?
Re: Equivalent of BDE TTable IndexName property?
Hello,
An analogue of the BDE IndexName property in UniDAC is the IndexFieldNames property
An analogue of the BDE IndexName property in UniDAC is the IndexFieldNames property
Re: Equivalent of BDE TTable IndexName property?
Thank you for responding. Here is some code I wrote that helps with transition from IndexName to IndexFieldNames. Especially useful for those converting from BDE (Paradox) application to UniDAC (Firebird or Interbase).
Firebird index names are unique throughout the database, so this code just works.
Firebird index names are unique throughout the database, so this code just works.
Code: Select all
// Given an Index-name return the columns that make up that index.
// Steve Faleiro; July 2013
function GetIndexFieldNamesByIndexName(const AUniConnection: TUniConnection;
const AIndexName: String): String;
var
um: TUniMetaData;
S: String;
begin
S := EmptyStr;
um := TUniMetaData.Create(nil);
try
um.Connection := AUniConnection;
um.Restrictions.Values['INDEX_NAME'] := AIndexName;
um.MetaDataKind := 'IndexColumns';
um.IndexFieldNames := 'COLUMN_POSITION';
um.Open;
while not um.Eof do
begin
S := S + um.FieldByName('COLUMN_NAME').AsString;
if um.RecNo <> um.Recordcount then
S := S + '; ';
um.Next;
end;
finally
um.Free;
end;
Result := S;
end;
Re: Equivalent of BDE TTable IndexName property?
Hello,
Yes, you can use the TUniMetaData component for retrieving the information about indexes. In addition, you can also retrieve the information about indexes by the table name.
Yes, you can use the TUniMetaData component for retrieving the information about indexes. In addition, you can also retrieve the information about indexes by the table name.