Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Failing
Hi Harry,
comments below.
On 28 Mar 2002 08:02:38 -0800, H_tompson_at_hotmail.com (Harry) wrote:
>Hi all,
>
>We have a trigger that updates table B when table A is modified.
>
>If it can't update table B immediatly (because of a lock on the
>table for example) what will it do? Will it fail? Will it wait?
Oracle's default behaviour is to wait forever.
>
>Is there anyway to control this behavior?
yes, you got to lock the record in table B first before updating it:
SELECT ...
FROM B
WHERE ...
FOR UPDATE NOWAIT;
The optional NOWAIT forces Oracle not to wait til the row is freed but
to return with errorcode -54. You may trap that error and continue as
you like.
>
>Thanking you..
>Harry
regards
Marc Blum
mailto:marc_at_marcblum.de
http://www.marcblum.de
Received on Thu Mar 28 2002 - 10:14:16 CST