Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Failing

Re: Trigger Failing

From: Marc Blum <marc_at_marcblum.de>
Date: Thu, 28 Mar 2002 16:14:16 GMT
Message-ID: <3ca34081.32067881@news.online.de>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US