小编Ale*_*lec的帖子

在H2中删除列的唯一约束

我尝试删除以前创建的h2中的列的唯一约束info varchar(255) unique.

我试过了:

sql> alter table public_partner drop constraint (select distinct unique_index_name from in
formation_schema.constraints where table_name='PUBLIC_PARTNER' and column_list='INFO');
Run Code Online (Sandbox Code Playgroud)

但没有成功(如下):

Syntax error in SQL statement "ALTER TABLE PUBLIC_PARTNER DROP CONSTRAINT ([*]SELECT DISTI
NCT UNIQUE_INDEX_NAME FROM INFORMATION_SCHEMA.CONSTRAINTS WHERE TABLE_NAME='PUBLIC_PARTNER
' AND COLUMN_LIST='INFO') "; expected "identifier"; SQL statement:
alter table public_partner drop constraint (select distinct unique_index_name from informa
tion_schema.constraints where table_name='PUBLIC_PARTNER' and column_list='INFO') [42001-1
60]
Run Code Online (Sandbox Code Playgroud)

如何正确删除此约束?

顺便说说:

sql> (select unique_index_name from information_schema.constraints where table_name='PUBLI
C_PARTNER' and column_list='INFO');
UNIQUE_INDEX_NAME
CONSTRAINT_F574_INDEX_9 …
Run Code Online (Sandbox Code Playgroud)

sql database h2

7
推荐指数
2
解决办法
1万
查看次数

如何检查Checkstyle中的"局部变量/字段的值是否未使用"?

如何检查The value of the local variable is not usedThe value of the field is not used使用Checkstyle?在Eclipse中有一个警告.但在Checkstyle中没有(我使用sun_checks.xml,略有修改).

我试着写我自己的支票,但作为一个新手,才发现如何计算(使用变量声明TokenTypes.VARIABLE_DEF),但我不知道如何找到即使用这些变量和字段的...

checkstyle

2
推荐指数
1
解决办法
2234
查看次数

标签 统计

checkstyle ×1

database ×1

h2 ×1

sql ×1