Oracle View Sequence Test
Category : Supporting Scripts
CREATE SEQUENCE seq_test MINVALUE 1 START WITH 1 INCREMENT BY 1 CACHE 20 / CREATE OR REPLACE FUNCTION func_seq_test (p_sequence in VARCHAR2) RETURN NUMBER IS l_nextval NUMBER; BEGIN EXECUTE IMMEDIATE 'select ' || p_sequence || '.nextval from dual' INTO l_nextval; RETURN l_nextval; END; / CREATE OR REPLACE VIEW view_seq_test AS SELECT func_seq_test('seq_test') seq_id , dummy FROM dual / SELECT * FROM view_seq_test / DROP SEQUENCE seq_test / DROP FUNCTION func_seq_test / DROP VIEW view_seq_test /