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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: default values using sequence.netval

Re: default values using sequence.netval

From: Rachel Carmichael <carmichr_at_hotmail.com>
Date: Tue, 13 Jun 2000 13:22:09 GMT
Message-Id: <10527.108907@fatcity.com>


you cannot fill a column with a default from a sequence... you will have to do this via a trigger

>From: "Anand Raman" <araman_at_india-today.com>
>Reply-To: ORACLE-L_at_fatcity.com
>To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
>Subject: default values using sequence.netval
>Date: Tue, 13 Jun 2000 04:57:02 -0800
>
>Hi guys
>I tried to do the following today
>
>sql> create sequence seq1start with 1000;
>
>sql> create table sometable (column1 number(15) not null default
>seq1.nextval primary key);
>
>oracle returned a error message
>ORA-00984: column not allowed here
>I am doing something wrong here..
>
>
>Also when i do something like
>SQL> select seq1.nextval , lu_user_id.nextval from dual;
>
> NEXTVAL NEXTVAL
> ---------- ----------
> 1000 1000
>
>Am i again doing something wrong..
>
>When i query for the nextval of the sequence 2 times i get the correct 2
>different results..
>
>SQL> select lu_user_id.nextval from dual;
>
> NEXTVAL
>----------
> 1001
>
>SQL> /
>
> NEXTVAL
>----------
> 1002
>
>
>Thanx for u r help
>
>Anand Raman
>
>--
>Author: Anand Raman
> INET: araman_at_india-today.com
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com Received on Tue Jun 13 2000 - 08:22:09 CDT

Original text of this message

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