More Related Content
Similar to Part9 sequence valule in table (20)
More from Girija Muscut (20)
Part9 sequence valule in table
- 2. SQL> create sequence seq1
2 START WITH 6
3 INCREMENT BY 1
4 NOCACHE
5 maxvalue 8
6 cycle;
Sequence created.
SQL> create table product(productid number(4), price number(6));
Table created.
SQL> insert into product values(1,seq1.nextval);
1 row created.
SQL> select * from product;
PRODUCTID PRICE
---------- ----------
1 6 2
DR. GIRIJA NARASIMHAN
- 3. DR. GIRIJA NARASIMHAN
3
SQL> insert into product values(2,seq1.nextval);
1 row created.
SQL> select * from product;
PRODUCTID PRICE
---------- ----------
1 6
2 7
SQL> insert into product values(3,seq1.nextval);
1 row created.
SQL> select * from product;
PRODUCTID PRICE
---------- ----------
1 6
2 7
3 8
SQL> insert into product values(4,seq1.nextval);
1 row created.
SQL> select * from product;
PRODUCTID PRICE
---------- ----------
1 6
2 7
3 8
4 1