Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!pd7cy2so!shaw.ca!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!ptdnetS!newsgate.ptd.net!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.golden.net!news.golden.net.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 12 Dec 2003 11:06:09 -0600
Date: Fri, 12 Dec 2003 12:06:09 -0500
From: Phil <phil@nospamthanks.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.server
Subject: Re: forcing the developers to use sequences
References: <qwlCb.402$Er.31529@mencken.net.nih.gov> <DXlCb.6952$G1.32047@tor-nn1.netcom.ca>
In-Reply-To: <DXlCb.6952$G1.32047@tor-nn1.netcom.ca>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <ppadncc_Rr4caESi4p2dnA@golden.net>
Lines: 26
NNTP-Posting-Host: 209.183.137.18
X-Trace: sv3-pp0OBMG2wAwKtZiwYkevLZYuaVjjZzWIt7GaGi/0GmYq3XmC+o0cxoa8XDmgG4AKxPmPpyQq4/4YxvG!wlcTPmw93pc8AgnlSbCSOcdFJerepNSYZkQdWboBnbY8OnqbIKk4zlIv6Db7m0iknZQ7lyLZJg==
X-Complaints-To: abuse@golden.net
X-DMCA-Complaints-To: abuse@golden.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.1
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:249994

Syltrem wrote:

> You can create a trigger AFTER INSERT on the table.
> This way, any value set by a program can be overridden by the trigger.
> That`s the best way to do it but it does not remove the need to educate
> programmers...
> 

The problem with using a trigger to populate the column is that it 
doesn't educate the programmers as what the proper solution is, as you 
have indicated.

The other problem with a trigger is that for those programmers that do 
use the sequence to populate the table, you have needless gaps in the 
numbers generated, which isn't a big deal, just avoidable.

A unique index on the column may help because the client program will 
fail when a duplicate value is attempted to be inserted or updated, 
which is a real probability with programmers not using the sequence to 
populate the column.  This puts the onus on them to fix their program to 
use the sequence.

HTH

Phil

