大侠们帮忙看看这个存储过程哪里错了。
SQL> create or replace procedure schedule_resources
2 (p_resource_name in varchar2,
3 p_start_time in date,
4 p_end_time in date
5 )
6 as
7 l_resource_name resources.resource_name%type;
8 l_cnt number;
9 begin
10 select resource_name into l_resource_name
11 from resources
12 where resource_name = p_resource_name
13 for update;
14 select count(*) into l_cnt
15 from schedules
16 where resource_name = p_resource_name
17 and (start_time <= p_end_time)
18 and (end_time >= p_start_time);
19 if(l_cnt <> 0)
20 then
21 raise_application_error
22 (-20001,'Room is already booked!');
23 end if;
24 insert into schedules
25 (resource_name,start_time,end_time)
26 values
27 (p_resource_name,p_start_time,p_end_time);
28 end schedle_resources;
显示编译错误
------解决方案--------------------
28 end schedle_resources;
这里改成
end schedule_resources;