Thursday 4 February 2010

Creating Sequence with synonym and grants

DROP Sequence hr.dept_seq
/
CREATE SEQUENCE hr.dept_seq
INCREMENT BY 1
START WITH 120
MINVALUE 0
MAXVALUE 99999999999
NOCYCLE
NOORDER
NOCACHE
/
GRANT SELECT ON hr.dept_seq TO PUBLIC
/
CREATE PUBLIC SYNONYM dept_seq for hr.dept_seq
/
SELECT DEPT_SEQ.CURRVAL from dual
/
SELECT dept_seq.nextval from dual
/

No comments: