FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CreateTable AND PrimaryKey
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
CreateTable AND PrimaryKey
Posted: Thu Aug 08, 2024 02:33 PM

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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: CreateTable AND PrimaryKey
Posted: Thu Aug 08, 2024 04:47 PM
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: CreateTable AND PrimaryKey
Posted: Fri Aug 09, 2024 02:37 AM

Yes

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion