primary index
primary index
How can I set the index to be the primary index for a TUniTable?
I need records to be returned in that order.
6.2.10, on D10
I need records to be returned in that order.
6.2.10, on D10
Re: primary index
You can use the IndexFieldNames property for sorting: https://www.devart.com/unidac/docs/?dev ... dnames.htm .
Re: primary index
I don't know the name of the field(s) making up the primary key. How do I find it? Can I somehow test either the whole table or each individual field?
Re: primary index
To retrieve the key field name, you can use the TUniConnection.GetKeyFieldNames method:
Code: Select all
lst := TStringList.Create;
try
UniConnection1.GetKeyFieldNames('DEPT', lst);
for I := 0 to Lst.Count - 1 do
ShowMessage(Lst[i]);
finally
lst.Free;
end;
Re: primary index
Thank, that works nicely for our oracle and postgresql database, but gives this error on mssql: "Unsupported metadata kind". Any trick there? (SQL Server 2008 R2 "express")
When looking in the documentation, I can see it was a new function in 5.5, but it is not listed otherwise.
When looking in the documentation, I can see it was a new function in 5.5, but it is not listed otherwise.
Re: primary index
Solved: A fully qualified tablename was needed "schema.tablename".
Re: primary index
Glad to see that you solved the problem. If you have any other questions, feel free to contact us
Re: primary index
This one is still open:
http://forums.devart.com/viewtopic.php?f=5&t=33107
And I hope you have made a note that documentation for GetKeyFieldNames is missing.
http://forums.devart.com/viewtopic.php?f=5&t=33107
And I hope you have made a note that documentation for GetKeyFieldNames is missing.
Re: primary index
We will add description of this method to the help shortly.