I am looking for a way to get a list of all foreign key relations in a database (ASA 16) including the setting for ON UPDATE and ON DELETE. I looked at several system views and stored procedures but none of those seem to include the ON UPDATE and ON DELETE setting

Anybody have a clue how to get that information?

asked 25 Sep, 05:09

Christian%20Hamers's gravatar image

Christian Ha...
31181019
accept rate: 50%


Try adding the SYSTRIGGER system view to your query. Rows with an according foreign_table_id describe the refaction in column "referential_action", such as "C" (for CASCADE) or "N" (for SET NULL).

Note: The doc page lists also "R" as type for restrict actions but I don't find such entries - I guess that's because for restricted actions, no system triggers are created...

So I guess a left join over SYSTRIGGER would allow to conclude that missing SYSTRIGGER entries mean those FKs have RESTRICT action.

permanent link

answered 25 Sep, 05:29

Volker%20Barth's gravatar image

Volker Barth
32.6k328476697
accept rate: 32%

And now I see it has already been answered before...:)

Memo to myself: Don't ignore the "Related questions" list on the rigt pane...

(25 Sep, 05:30) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×235
×30
×28

question asked: 25 Sep, 05:09

question was seen: 79 times

last updated: 25 Sep, 05:33