Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Table Design!
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
![]() |
![]() |