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

Home -> Community -> Usenet -> c.d.o.server -> Re: Table Design!

Re: Table Design!

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 14 Nov 2005 08:05:43 -0800
Message-ID: <1131984426.593167@yasure>


gazzag wrote:
> SQL> create table tablea (
> colid number,
> col_text varchar2(50));
>
> Table created.
>
> SQL> create sequence tablea_seq
> start with 1
> increment by 1;
>
> Sequence created.
>
> SQL> insert into tablea values (tablea_seq.nextval, 'Row 1');
>
> 1 row created.
>
> SQL> insert into tablea values (tablea_seq.nextval, 'Row 2');
>
> 1 row created.
>
> SQL> insert into tablea values (tablea_seq.nextval, 'Row 3');
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select * from tablea;
>
> COLID COL_TEXT
> ---------- --------------------------------------------------
> 1 Row 1
> 2 Row 2
> 3 Row 3
>
> SQL>
I'd suggest adding ORDER to the sequence DDL unless it is a single user system.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Nov 14 2005 - 10:05:43 CST

Original text of this message

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