This is the table I have created:
CREATE TABLE Toy (Toy_No NUMBER PRIMARY KEY, Toy_Name VARCHAR(30) NOT NULL );
This is the sequence I have created:
CREATE SEQUENCE toy_seq MINVALUE 1 START WITH 1 INCREMENT BY 1 CACHE 20;
Then I tried creating a simple stored procedure with output parameter:
CREATE OR REPLACE PROCEDURE insert_toys(toy_id OUT NUMBER,toy_name VARCHAR(30)) AS BEGIN toy_id := seq_toy.NEXTVAL; INSERT INTO Toy (Toy_No,Toy_Name) VALUES (toy_id,toy_name); END;
But I'm getting a compilation error. Where can be the mistake possibly be ?