Page 1 of 1

MySql MariaDatase INDEX

Posted: Wed Apr 19, 2023 7:37 pm
by mauri.menabue
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

Re: MySql MariaDatase INDEX

Posted: Wed Apr 19, 2023 8:01 pm
by vilian
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`)")

Re: MySql MariaDatase INDEX

Posted: Wed Apr 19, 2023 9:49 pm
by mauri.menabue
Hi all
Thank Vilian
is also possible : oCN:Execute("ALTER TABLE your_table ADD INDEX your_index(`field1`, `My_function()`)")

Re: MySql MariaDatase INDEX

Posted: Wed Apr 19, 2023 10:22 pm
by vilian
I think no.