Path: newssvr20.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!newsfeed.telusplanet.net!newsfeed.telus.net!news3.optonline.net!newsfeed-east.nntpserver.com!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!falcon.america.net!eagle.america.net.POSTED!not-for-mail
From: Jonathan Gennick <jonathan@gennick.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: forcing the developers to use sequences
Reply-To: jonathan@gennick.com
Message-ID: <a0tktvg3ik765nc8kqld9k7843qvp213jg@4ax.com>
References: <qwlCb.402$Er.31529@mencken.net.nih.gov> <DXlCb.6952$G1.32047@tor-nn1.netcom.ca> <ppadncc_Rr4caESi4p2dnA@golden.net>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 26
Date: Fri, 12 Dec 2003 21:08:28 -0500
NNTP-Posting-Host: 12.37.13.79
X-Trace: eagle.america.net 1071281320 12.37.13.79 (Fri, 12 Dec 2003 21:08:40 EST)
NNTP-Posting-Date: Fri, 12 Dec 2003 21:08:40 EST
Organization: 24hoursupport.com
Xref: newssvr20.news.prodigy.com comp.databases.oracle.server:250036

On Fri, 12 Dec 2003 12:06:09 -0500, Phil <phil@nospamthanks.com>
wrote:

>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.

I'd use a trigger, at least I'd strongly consider using a trigger, not
so much to *force* the developers, but to avoid leaving open the hole
whereby someone inadvertently doesn't use the sequence, because if
that happens, and the sequence eventually hits the value that was
inadvertently used, you could get a primary key violation, and you,
the DBA, would need to adjust the sequence. 

There may be reasons not to use a trigger, but if it was important
that the column always be populated from a trigger, I'd sure try and
centralize that functionality in the database.

Jonathan Gennick --- Brighten the corner where you are
http://Gennick.com

Join the Oracle-article list and receive one article on Oracle
technologies per month by email. To join, visit
http://four.pairlist.net/mailman/listinfo/oracle-article, or send
email to Oracle-article-request@gennick.com and include the word
"subscribe" in either the subject or body.
