GetFieldDesc

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

GetFieldDesc

Post by radub » Mon 09 Aug 2010 10:14

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.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 09 Aug 2010 14:44

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:

Code: Select all

var
  primary_keys: TStringList;
begin
  primary_keys := TStringList.Create;
  OraQuery1.GetKeyList('TABLE_NAME', primary_keys);
  ShowMessage(primary_keys.Text);
end;

radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

Post by radub » Tue 10 Aug 2010 09:08

Thank you.

radub
Posts: 105
Joined: Sat 10 Jul 2010 18:46

Post by radub » Tue 10 Aug 2010 09:08

Thank you.

Post Reply