Does somebody know how I can drop an unnamed unique constraint ?
Thanks for your help and the great job HSQLDB is.
Unnamed constraints are given a name by the database engine. You can check the relevant INFORMATION_SCHEMA tables to find the name of the constraint. You can then use the name to drop the constraint.
Thank you for the quick answer.
I've found the name of the constraint (SYS_CT_10184). But I'm wondering: the same sql files defining unnamed unique constraints are used to create multiple instance of the database. Will the generated name be always the same in all the databases ?
Another thing I remarked is that if instead of writing my database in a file, I use the in memory mode, then the ALTER TABLE mytable DROP CONSTRAINT SYS_CT_10184 fails saying that the constraint named SYS_CT_10184 does not exist.
The generated name can be different in different databases.
In the second case, you must query the memory database for the actual name.
Do you mean that to delete this unnamed unique constraint, my only solution is to drop the table defining it (after having copied its content for example) ?
No. You can write a program to query the INFORMATION_SCHEMA table and find the constraint name from the table name and column names. The name is then used to construct an SQL statement to DROP the constraint.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.