here is my room table and data-
create table room(
room_no integer not null,
catagori varchar(20) not null,
quality varchar(20) not null,
price integer not null,
primary key(room_no)
);
set serveroutput on;
create or replace procedure room_av(
roomno room.room_no%type,
catagoris room.catagori%type,
qua room.quality%type,
pri room.price%type) is
begin
insert into room (room_no,catagori,quality,price) values (roomno,catagoris,qua,pri);
commit;
end room_av;
/
begin
room_av(102,'single','2nd_class',200);
room_av(103,'single','2nd_class',200);
room_av(104,'single','2nd_class',200);
room_av(105,'single','2nd_class',200);
room_av(202,'single','1st_class',300);
room_av(203,'single','1st_class',300);
room_av(204,'single','1st_class',300);
room_av(205,'single','1st_class',300);
room_av(302,'double','2nd_class',250);
room_av(303,'double','2nd_class',250);
room_av(304,'double','2nd_class',250);
room_av(305,'double','2nd_class',250);
room_av(402,'double','1st_class',400);
room_av(403,'double','1st_class',400);
room_av(404,'double','1st_class',400);
room_av(405,'double','1st_class',400);
room_av(406,'double','1st_class',400);
end;
/
here is my customer_info table
drop table customer_info;
create table customer_info(
first_name varchar(20) not null,
last_name varchar(20) not null,
room_no integer not null,
catagori varchar(20) not null,
quality varchar(20) not null,
price integer not null,
date_open date not null,
primary key(room_no)
);
here is my trigger
create or replace trigger cust_room
before INSERT ON customer_info
FOR EACH ROW
BEGIN
insert into customer_info(catagori,quality,price) select catagori,quality,price from room where room_no=:new.room_no;
END cust_room;
/
the trigger is created successfully but when i am executing the command
insert into customer_info (first_name,last_name,room_no,date_open) values ('Tanmoy','Saha','202','21-jul-2010');
then mutating error occur
how can i solve this problem???