« 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 Julio Carneiro :: Rate this Message:

Reply to Author | View in Thread

Josh,

I do not see any reference to SQL System Tables in the SQL reference  
manual. The only place where those tables are mentioned is in the V11  
Upgrade manual.
And I do not see anything on the 'auto increment' property there.

I know I can set/check a Primary Key constraint via SQL, but there is  
no way to do that via the Structure Editor :( which would be the  
natural place for that.
Hence my plan to use the auto-increment property.

julio

On Jul 2, 2009, at 8:41 PM, Josh Fletcher (4D, Inc.) wrote:

> Hi Julio,
>
> I would use the SQL System Tables...in this case I think you want  
> _USER_COLUMNS.
>
> Check the SQL Reference for more information.
>
> Note that you can also simply define Primary keys in SQL but you'd  
> have to retrofit your structure.
>
> -Josh
>
>
> Julio Carneiro wrote:
>> In pre-V11 I used a convention to flag a field as Primary Key: any  
>> field with indexed+unique+nonenterable+nonmodifiable+displayonly  
>> attributes is a PK for me.
>> In V11 I want to use a different combination: autoincrement+unique  
>> ==>  PK.
>> I checked the documentation and could not find a way to get the  
>> 'auto  increment' field attribute.
>> Neither Get Field Properties nor Get Field Entry Properties  
>> returns  that attribute.
>> Does anyone know a way to get that info? Is it available in the  
>> System  Tables, accessible via SQL?
>> TIA
>> julio
>

**********************************************************************
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