如何确定HSQLDB中定义了哪些外键?
如何知道 HSQLDB 中定义了哪些外键?
我从文档中得到的最好的信息是:
select * from INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
但这只给了我以下内容。
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE
------------------ ----------------- --------------- ------------------------- ------------------------ ---------------------- ------------ ----------- -----------
PUBLIC PUBLIC SYS_FK_10078 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10079 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION NO ACTION
PUBLIC PUBLIC SYS_FK_10080 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10116 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10120 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10124 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION NO ACTION
PUBLIC PUBLIC SYS_FK_10128 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10131 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
我需要知道哪些表和列分配了外键,并且我需要能够删除它们。
How can I tell what foreign keys have been defined in HSQLDB?
The best I've gleened from the documentation is:
select * from INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
But that only gave me the following.
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE
------------------ ----------------- --------------- ------------------------- ------------------------ ---------------------- ------------ ----------- -----------
PUBLIC PUBLIC SYS_FK_10078 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10079 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION NO ACTION
PUBLIC PUBLIC SYS_FK_10080 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10116 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10120 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10124 PUBLIC PUBLIC SYS_PK_10029 NONE NO ACTION NO ACTION
PUBLIC PUBLIC SYS_FK_10128 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
PUBLIC PUBLIC SYS_FK_10131 PUBLIC PUBLIC SYS_PK_10071 NONE NO ACTION CASCADE
I need to know what tables and columns have foreign keys assigned, and I need to be able to delete them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将以下选择与 REFERENTIAL_CONSTRAINTS 视图结合使用:
或者,INFORMATION_SCHEMA.SYSTEM_CROSSREFERENCE 视图是外键及其表和列的自包含视图。
请参阅http://hsqldb.org/doc/2.0/guide/databaseobjects- chapt.html#dbc_information_schema 获取列表。
You can use the following selects in conjunction with the REFERENTIAL_CONSTRAINTS view:
Alternatively, the INFORMATION_SCHEMA.SYSTEM_CROSSREFERENCE view is a self contained view of foreign keys, their tables and columns.
See http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_information_schema for a list.