关于存储过程执行出错的问题?
请问以下存储过程有什么错误,该如何修改才不会出错,谢谢!
CREATE OR REPLACE PROCEDURE P_CreateScheduleDate (startDate in datetime,endDate in datetime) as
--l_num int;
l_date datetime;
BEGIN
--create table TD_ScheduleDate (F_ID number(8) not null,F_Date date not null);
--commit;
l_date :=startDate;
--l_num :=1;
while l_date <= endDate loop
--insert into TD_ScheduleDate values(l_num,l_date);
insert into TD_ScheduleDate values(l_date);
l_date :=l_date + 1 ;
--l_num := l_num + 1;
END LOOP;
--insert into TD_ScheduleDate values(l_num,l_date);
commit;
END P_CreateScheduleDate;
执行时提示的错误,该如何修改!
Server: Msg 156, Level 15, State 1, Line 1
在关键字 'OR' 附近有语法错误。
Server: Msg 170, Level 15, State 1, Line 9
第 9 行: 'loop' 附近有语法错误。
Server: Msg 128, Level 15, State 1, Line 11
在此上下文中不允许使用 'l_date'。此处只允许使用常量、表达式或变量。不允许使用列名。