CreateTable AND PrimaryKey

Post Reply
User avatar
vilian
Posts: 985
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

CreateTable AND PrimaryKey

Post by vilian »

Hi Guys,

How could i create a mysql table and at the same time define its primarykey? Is it possible?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
Posts: 985
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: CreateTable AND PrimaryKey

Post by vilian »

Answering myself :)

I already found out it. Just add "PRI" in the struct.

Eg: aFld := {{"COD","C",3,0,"PRI"},{"NOME","C",30,0}}

oCn:CreateTable("test", aFld), will create the table "test" and set the field "COD" as your primary key.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: CreateTable AND PrimaryKey

Post by nageswaragunupudi »

Yes
Regards

G. N. Rao.
Hyderabad, India
Post Reply