Oracle get foreign keys

后端 未结 3 579
有刺的猬
有刺的猬 2020-12-06 17:35

I\'d like to get all foreign keys in a schema, like this. Let\'s say I have tables

users(id, username, pass, address_id)

and

addr

3条回答
  •  情歌与酒
    2020-12-06 18:16

    They are listed in the system view ALL_CONSTRAINTS

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1037.htm#i1576022

    Edit

    The columns involved in the constraints are listed in ALL_CONS_COLUMNS

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1035.htm#i1575870

提交回复
热议问题