make multiple, composite query in oracle

Posted by Meloun on Stack Overflow See other posts from Stack Overflow or by Meloun
Published on 2010-04-13T11:23:22Z Indexed on 2010/04/13 12:23 UTC
Read the original article Hit count: 322

Filed under:
|
|

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');

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about sql