Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.


There is the Locks During Deletes section in the docs, but it lacks info about triggers. I need a confirmation about row-level BEFORE DELETE trigger firing time: does it fire just after write lock is acquired on the row to be deleted?

It would be great if this info was added to that docs section.


P. s.: sections Locks During Inserts and Locks During Updates are missing info about BEFORE triggers too.

asked 05 Oct '21, 04:35

Arthoor's gravatar image

accept rate: 11%

edited 05 Oct '21, 05:47


AFAIK a connection will obtain all necessary locks to permit a SQL operation before any part of that operation is processed.

It would make no sense to allow any part of a trigger to start executing before some other connection obtained a conflicting lock that blocks the lock this connection needs.

Having said that, a statement in the docs (or an example) would be nice.

(05 Oct '21, 08:29) Breck Carter

FWIW, here's an old posting by Glenn Paulley with detailed insights (as expected...) on the internal steps a trigger has to consider - cf. that old NNTP article "Before update trigger and computed column ".

Sigh, the old link does not work currently, the following might help:

Note: It does not tell about locks but shows when the different kind of triggers are fired, in this case for INSERT. As Breck has stated, apparently locks must be placed before any data is modified, including the trigger's action.

(05 Oct '21, 09:25) Volker Barth
Be the first one to answer this question!
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: 05 Oct '21, 04:35

question was seen: 736 times

last updated: 05 Oct '21, 09:34