Equivalent of BDE TTable IndexName property?
Posted: Thu 25 Jul 2013 22:08
For TUniTable (Interbase provider), what is the equivalent property for BDE TTable IndexName?
Discussion forums for open issues and questions concerning database tools, data access components and developer tools from Devart
https://forums.devart.com/
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;