Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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 '18, 05:09

Christian%20Hamers's gravatar image

Christian Ha...
accept rate: 42%

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 '18, 05:29

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

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 '18, 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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 25 Sep '18, 05:09

question was seen: 1,313 times

last updated: 25 Sep '18, 05:33