Hello,
I have used the TField method GetFieldDesc(FiledName).IsKey in SDAC to obtain the PK fields for a table (see http://www.devart.com/forums/viewtopic.php?t=18570), but looks like ODAC doesn't know about this function. In my ODAC v5.70 I have used KeyFields property with success, but after putting the 6.90 trial version, KeyFields returns wrong fields name; the property is empty, I didn't fill in anything.
I am using D6, Ora 10.2g, Win XP sp3.
Any help for retrieving PK with ODAC would be appreciated.
Thank you
Radu B.
GetFieldDesc
Hello
ODAC has the GetKeyList function that returns fields list in the primary key. But this function is case sensitive, so, table name should be defined in the upper case:
ODAC has the GetKeyList function that returns fields list in the primary key. But this function is case sensitive, so, table name should be defined in the upper case:
Code: Select all
var
primary_keys: TStringList;
begin
primary_keys := TStringList.Create;
OraQuery1.GetKeyList('TABLE_NAME', primary_keys);
ShowMessage(primary_keys.Text);
end;