Hi Guys,
How could i create a mysql table and at the same time define its primarykey? Is it possible?
CreateTable AND PrimaryKey
Re: CreateTable AND PrimaryKey
Answering myself ![Smile :)](./images/smilies/icon_smile.gif)
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.
![Smile :)](./images/smilies/icon_smile.gif)
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.
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact: