<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sequence-less/Trigger-less Oracle Auto Increment</title>
	<atom:link href="http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/feed" rel="self" type="application/rss+xml" />
	<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment</link>
	<description>Some People Are Squirrel Handed.</description>
	<lastBuildDate>Thu, 12 Jan 2012 15:56:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: KV Australia</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-43336</link>
		<dc:creator>KV Australia</dc:creator>
		<pubDate>Fri, 05 Feb 2010 05:59:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-43336</guid>
		<description>To all who think Oracle SUCKS, you&#039;ve got no clue what Oracle can do and probably 
have no idea about database designing either.

Most non trivial tables have primary key (THE most important column or columns) that uniquely identifies data in rest of the row. In all but trivial application, you&#039;d want a meaningless auto-incrementing number to take its place.  Even when you insert a
autoincrementing number, you&#039;d want the value back for foreign key elsewhere.
 
Almost all databases that support autoincrement encourage a programmer 
to abandon these good DB design norms by allowing an easier option of 
creating a fake primary key instead. 

By not providing Autoincrement, Oracle is forcing designer to THINK..

And that is THE MOST important advantage, I THINK!!!</description>
		<content:encoded><![CDATA[<p>To all who think Oracle SUCKS, you&#8217;ve got no clue what Oracle can do and probably<br />
have no idea about database designing either.</p>
<p>Most non trivial tables have primary key (THE most important column or columns) that uniquely identifies data in rest of the row. In all but trivial application, you&#8217;d want a meaningless auto-incrementing number to take its place.  Even when you insert a<br />
autoincrementing number, you&#8217;d want the value back for foreign key elsewhere.</p>
<p>Almost all databases that support autoincrement encourage a programmer<br />
to abandon these good DB design norms by allowing an easier option of<br />
creating a fake primary key instead. </p>
<p>By not providing Autoincrement, Oracle is forcing designer to THINK..</p>
<p>And that is THE MOST important advantage, I THINK!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adnan Hashmi</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-40467</link>
		<dc:creator>Adnan Hashmi</dc:creator>
		<pubDate>Sun, 15 Jun 2008 10:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-40467</guid>
		<description>/* Create its trigger */
CREATE  SEQUENCE  TIME_COMPANY_COMPANYID_SEQ
	START WITH 1
	INCREMENT BY 1

/* My table is **/
CREATE TABLE TIME_COMPANY 
(
	COMPANYID integer  NOT NULL , 
	COMPANYNAME varchar2 (100) NOT NULL 
)

/* And its trigger would be like */
CREATE OR REPLACE TRIGGER TIME_COMPANY_TR
BEFORE INSERT ON TIME_COMPANY
FOR EACH ROW
DECLARE TEMP_NO INT; 
 BEGIN 
	 SELECT TIME_COMPANY_COMPANYID_SEQ.NEXTVAL INTO :NEW.COMPANYID FROM DUAL;
END;

Regards
Adnan Hashmi.</description>
		<content:encoded><![CDATA[<p>/* Create its trigger */<br />
CREATE  SEQUENCE  TIME_COMPANY_COMPANYID_SEQ<br />
	START WITH 1<br />
	INCREMENT BY 1</p>
<p>/* My table is **/<br />
CREATE TABLE TIME_COMPANY<br />
(<br />
	COMPANYID integer  NOT NULL ,<br />
	COMPANYNAME varchar2 (100) NOT NULL<br />
)</p>
<p>/* And its trigger would be like */<br />
CREATE OR REPLACE TRIGGER TIME_COMPANY_TR<br />
BEFORE INSERT ON TIME_COMPANY<br />
FOR EACH ROW<br />
DECLARE TEMP_NO INT;<br />
 BEGIN<br />
	 SELECT TIME_COMPANY_COMPANYID_SEQ.NEXTVAL INTO :NEW.COMPANYID FROM DUAL;<br />
END;</p>
<p>Regards<br />
Adnan Hashmi.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ralph</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-37217</link>
		<dc:creator>ralph</dc:creator>
		<pubDate>Wed, 19 Mar 2008 23:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-37217</guid>
		<description>How hard from Oracle to just add the keyword AUTO_INCREMENT or IDENTITY to the identity field? and forget about this sequence/trigger crap?</description>
		<content:encoded><![CDATA[<p>How hard from Oracle to just add the keyword AUTO_INCREMENT or IDENTITY to the identity field? and forget about this sequence/trigger crap?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ingas</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-36956</link>
		<dc:creator>Ingas</dc:creator>
		<pubDate>Fri, 22 Feb 2008 01:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-36956</guid>
		<description>Not much fun of triggers, but Oracle triggers is total crap.
Because of FOR EACH ROW
Disgusting.</description>
		<content:encoded><![CDATA[<p>Not much fun of triggers, but Oracle triggers is total crap.<br />
Because of FOR EACH ROW<br />
Disgusting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neel_basu</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-36696</link>
		<dc:creator>neel_basu</dc:creator>
		<pubDate>Thu, 10 Jan 2008 10:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-36696</guid>
		<description>MySQL also sucks at the time of Relation database Modeling with references but thats 100 times easier that this auto increamentation technique of Oracle.
So I think PostgreSql is easiest and Simplest and the best one
can host a Huge ammount of Data like Oracle
NOT a MEMORY HOG Like Oracle
and Its SQL is easier that anything else.</description>
		<content:encoded><![CDATA[<p>MySQL also sucks at the time of Relation database Modeling with references but thats 100 times easier that this auto increamentation technique of Oracle.<br />
So I think PostgreSql is easiest and Simplest and the best one<br />
can host a Huge ammount of Data like Oracle<br />
NOT a MEMORY HOG Like Oracle<br />
and Its SQL is easier that anything else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lemine</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-36281</link>
		<dc:creator>Lemine</dc:creator>
		<pubDate>Fri, 07 Dec 2007 03:34:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-36281</guid>
		<description>I agree with you that Oracle really sucks. MySQL is a better choice.</description>
		<content:encoded><![CDATA[<p>I agree with you that Oracle really sucks. MySQL is a better choice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Life After Coffee &#187; Re: The web is becoming a dictatorship of idiots - Part 1</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-27228</link>
		<dc:creator>Life After Coffee &#187; Re: The web is becoming a dictatorship of idiots - Part 1</dc:creator>
		<pubDate>Mon, 26 Mar 2007 12:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-27228</guid>
		<description>[...] Here&#8217;s a good example where Matt posted what he thought was a good idea of how to create auto-increment fields in Oracle without the use of Triggers. [...]</description>
		<content:encoded><![CDATA[<p>[...] Here&#8217;s a good example where Matt posted what he thought was a good idea of how to create auto-increment fields in Oracle without the use of Triggers. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sije de Haan</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-21602</link>
		<dc:creator>Sije de Haan</dc:creator>
		<pubDate>Sat, 17 Feb 2007 20:14:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-21602</guid>
		<description>I don&#039;t understand. This problem can be solved by using sequences. But what if two overlapping transactions want to add a value to a field. One of the two updates will get lost?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand. This problem can be solved by using sequences. But what if two overlapping transactions want to add a value to a field. One of the two updates will get lost?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-12663</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 25 Nov 2006 14:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-12663</guid>
		<description>Yup...I know that already.  Read the post again and note the last line ;)  Thanks anyhow.</description>
		<content:encoded><![CDATA[<p>Yup&#8230;I know that already.  Read the post again and note the last line ;)  Thanks anyhow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment/comment-page-1#comment-12481</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 22 Nov 2006 19:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.borkweb.com/story/sequence-lesstrigger-less-oracle-auto-increment#comment-12481</guid>
		<description>Sorry, no.

This won&#039;t work in an envioronment where more than one transaction is open at once.  That means you should never ever use it because it&#039;s bad practice and not scalable.  (You never really know where it will end up.)

If two users do this at the nerly same time, more specifically if a second user does their insert after the first but before the first user commits, the second commit will fail with a constraint violation.  That is, unless the column isn&#039;t unique, in which case you&#039;ll just get duplicate values.</description>
		<content:encoded><![CDATA[<p>Sorry, no.</p>
<p>This won&#8217;t work in an envioronment where more than one transaction is open at once.  That means you should never ever use it because it&#8217;s bad practice and not scalable.  (You never really know where it will end up.)</p>
<p>If two users do this at the nerly same time, more specifically if a second user does their insert after the first but before the first user commits, the second commit will fail with a constraint violation.  That is, unless the column isn&#8217;t unique, in which case you&#8217;ll just get duplicate values.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

