« Return to Thread: Is there a way to get a table's primary key in V11

Re: Is there a way to get a table's primary key in V11

by Arnaud de Montard :: Rate this Message:

Reply to Author | View in Thread


Le 3 juil. 09 à 02:24, Julio Carneiro a écrit :

> I am writing generic code where all I know is a table name and I  
> need to find that table's Primary Key.

I use hard coded field names, for example a field having the same name  
as the table followed by "_ID" is the PK.
   [Table1]Table1_ID -> primary key
   [Table2]Table1_ID -> foreign key
   [Table1]TScreate -> time stamp created
   [Table1]TSmodif -> time stamp modified

--
Arnaud de Montard




**********************************************************************
Live Data Mapping Services with 4D v11 SQL
See it for yourself - http://www.4d.com/solutions/ndwater.html

4D Internet Users Group (4D iNUG)
FAQ:  http://www.4D.com/support/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************

 « Return to Thread: Is there a way to get a table's primary key in V11