dbTalk Databases Forums  

to add table with primary key

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss to add table with primary key in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bumsys@gmail.com
 
Posts: n/a

Default to add table with primary key - 02-28-2008 , 07:01 AM






create table au_clients (
id number(10) not null,
name varchar2(255) not null,
constraint au_clients_pk primary key (id));
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?

Reply With Quote
  #2  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM






Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #3  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM



Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #4  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM



Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #5  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM



Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #6  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM



Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #7  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM



Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #8  
Old   
codadilupo
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:13 AM



Bumsys (AT) gmail (DOT) com wrote:

Quote:
create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?
create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.


Reply With Quote
  #9  
Old   
shakespeare
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:24 AM




"codadilupo" <yossarian99 (AT) operamail (DOT) com> schreef in bericht
news:47c6b383$0$11543$5fc30a8 (AT) news (DOT) tiscali.it...
Quote:
Bumsys (AT) gmail (DOT) com wrote:

create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?

create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.
This will not guarantee that your key will actually start with 0. If you
insert the first record, but do not commit (rollback), 0 will be missing.
Of course you can (and I guess you will) insert the first record yourself,
but I often wonder why people use sequences and want to keep control of the
values.

Shakespeare




Reply With Quote
  #10  
Old   
shakespeare
 
Posts: n/a

Default Re: to add table with primary key - 02-28-2008 , 07:24 AM




"codadilupo" <yossarian99 (AT) operamail (DOT) com> schreef in bericht
news:47c6b383$0$11543$5fc30a8 (AT) news (DOT) tiscali.it...
Quote:
Bumsys (AT) gmail (DOT) com wrote:

create sequence au_clients_seq start with 1 increment by 1
nomaxvalue;

i want that primary fey start with 0. what can do in this case?

create sequence au_clients_seq start with 0 MINVALUE 0 increment by 1
nomaxvalue;

C.
This will not guarantee that your key will actually start with 0. If you
insert the first record, but do not commit (rollback), 0 will be missing.
Of course you can (and I guess you will) insert the first record yourself,
but I often wonder why people use sequences and want to keep control of the
values.

Shakespeare




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.