如何确定HSQLDB中定义了哪些外键?

发布于 2024-11-03 08:36:41 字数 1869 浏览 4 评论 0原文

如何知道 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑凤梨 2024-11-10 08:36:41

您可以将以下选择与 REFERENTIAL_CONSTRAINTS 视图结合使用:

select * from information_schema.constraint_column_usage
select * from information_schema.constraint_table_usage

或者,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:

select * from information_schema.constraint_column_usage
select * from information_schema.constraint_table_usage

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文