MySql MariaDatase INDEX

MySql MariaDatase INDEX

Postby mauri.menabue » Wed Apr 19, 2023 7:37 pm

Hi all,
I would like to know how to remove an index on a MySql MariaDatase table.
To create an index, the 'UNIQUE' clause is used. How to delete an index?

how to build compound index INDEX ON CLI_COD + STR(CLI_FAT,12,2) + DTOS(date())
TIA
Maurizio Menabue
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: MySql MariaDatase INDEX

Postby vilian » Wed Apr 19, 2023 8:01 pm

TO REMOVE
oCN:Execute("ALTER TABLE your_table DROP INDEX your_index")

TO CREATE
oCN:Execute("ALTER TABLE your_table ADD INDEX your_index(`field1`, `field2`)")
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 978
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: MySql MariaDatase INDEX

Postby mauri.menabue » Wed Apr 19, 2023 9:49 pm

Hi all
Thank Vilian
is also possible : oCN:Execute("ALTER TABLE your_table ADD INDEX your_index(`field1`, `My_function()`)")
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: MySql MariaDatase INDEX

Postby vilian » Wed Apr 19, 2023 10:22 pm

I think no.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 978
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests