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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PRAGMA AUTONOMOUS_TRANSACTION in a trigger

Re: PRAGMA AUTONOMOUS_TRANSACTION in a trigger

From: Ken Denny <ken_at_kendenny.com>
Date: 4 Apr 2005 09:09:30 -0700
Message-ID: <1112630970.717877.246900@g14g2000cwa.googlegroups.com>


whitegoose_at_inorbit.com wrote:
>
> That is to say, I need my trigger, on the JOB table, to check to see
if
> the JOB.JOBTYPE = 'RES' before insert/update. If so I then check to
see
> whether another row in JOB with a JOBTYPE = 'RES' has the same
address
> (STREETNAME, STREETNO, STREETTYPE, CITY). If so, I
> RAISE_APPLICATION_ERROR.
You could add a sequence column and a unique index on jobtype, address, and the sequence, then have a trigger get the nextval for the sequence for jobtype != 'RES' and set it to 0 when jobtype = 'RES'
>
> So I need to be able to select from JOB to compare the values of the
> current row to the values of the other rows.
>
> FYI. I am trying to write code that will work for 8i but the client
> will soon be upgrading to a version that is unknown at this stage. I
> would not expect it to be 10g

I don't think autonomous transaction was available in 8i.

Ken Denny Received on Mon Apr 04 2005 - 11:09:30 CDT

Original text of this message

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