With TUniMetaData, I have looked at all the information it provides for various MetaDataKind options for different database types. The one thing I am having a problem finding is auto increment fields.
Is this attribute easily defined or perhaps I need some help interpreting the data I am looking at.
Thank you.
TUniMetaData - Find AutoIncrement fields
Re: TUniMetaData - Find AutoIncrement fields
TUniMetaData does not provide metadata about autoincrement fields. You can use the following code to determine the autoincrement field in the dataset:
Alternatively, you can create SQL queries by yourself to get metadata for each Uni provider.
Code: Select all
uses
..., DBAccess, CRAccess;
...
procedure TForm1.Button1Click(Sender: TObject);
var
RecordSet: TCRRecordSet;
begin
...
UniQuery1.SQL.Text := 'select * from emp';
UniQuery1.Open;
RecordSet := TDBAccessUtils.GetIRecordSet(UniQuery1);
if RecordSet.IdentityField <> nil then
ShowMessage('IdentityField=' + RecordSet.IdentityField.Name)
else
ShowMessage('No identity field');
end;
-
- Posts: 5
- Joined: Mon 10 Jul 2017 21:49
Re: TUniMetaData - Find AutoIncrement fields
Thank you. I have actually decided to go the route of writing the SQL query for the meta data of each type to collect this info.