make multiple, composite query in oracle
- by Meloun
How can i make multiple, composite query in oracle?
for example this several queries in one step?
1
CREATE TABLE test (id NUMBER PRIMARY KEY, name VARCHAR2(30));
2
CREATE SEQUENCE test_sequence START WITH 1 INCREMENT BY 1;
3
CREATE OR REPLACE TRIGGER test_trigger
BEFORE INSERT
ON test
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT test_sequence.nextval INTO :NEW.ID FROM dual;
END;
4
INSERT INTO test (name) VALUES ('Jon');
5
INSERT INTO test (name) VALUES ('Meloun');