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: Default column value of MAX +1 of column - possible in Oracle 9i?

Re: Default column value of MAX +1 of column - possible in Oracle 9i?

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Sat, 26 Mar 2005 15:40:56 -0800
Message-ID: <1111880453.318579@yasure>


Dave wrote:

>>If that is all you meant then I agree. But that is hardly what you wrote.
>>--
>>Daniel A. Morgan
>>University of Washington
>>damorgan_at_x.washington.edu
>>(replace 'x' with 'u' to respond)

> 
> 
> point taken - and it was all that i meant 

Now that there is agreement there is one point that should also be made.

When one writes:

INSERT INTO t (pkcol) VALUES (pkseq.NEXTVAL);

it is efficient but leaves open the possibility that someone may perform an insert not using that code. This is the very same liability that exists when one assumes that their application will enforce data integrity and doesn't create foreign keys.

When viewed from one standpoint, the one we are discussing, I agree the trigger is not as clean as the simple insert statement. But when viewed as part of an application I will still prefer the trigger just as I prefer the referential constraint.

Part of my job is performance and scalability. Part of my job is to defend the integrity of the data. One can not be sacrificed for the other.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Sat Mar 26 2005 - 17:40:56 CST

Original text of this message

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