well that only works if you have control over the structure.
for a generic component one cannot rely on naming conventions.
I have to use metadata associated to a table/field.
julio
On Jul 3, 2009, at 12:38 PM, arnaud wrote:
>
> 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.html4D Internet Users Group (4D iNUG)
FAQ:
http://www.4D.com/support/faqnug.htmlArchive:
http://lists.4D.com/archives.htmlOptions:
https://lists.4d.com/mailman/options/4d_techUnsub: mailto:
4D_Tech-Unsubscribe@...
**********************************************************************