这套东西是从MSSQL看的,自己改成了ORACLE的,用的是8I,包如下:--个人日程管理程序包,包头scott.pa_rcgl
create or replace package scott.pa_rcgl as
--声明引用游标类型
type mycursor is ref cursor;
--返回所有优先级的记录集
procedure filltaskprioritybox(rdata out pa_rcgl.mycursor);
--返回所有日程类型的记录集
procedure filltasktypebox(rdata out pa_rcgl.mycursor);
--返回所有日程
procedure getallschedule(rdata out pa_rcgl.mycursor);
--返回指定日期的日程,输入参数是希望查看的日期,输出参数是当天所有日程
procedure getschedulebyid(in_date in date,rdata out pa_rcgl.mycursor); --返回指定日程ID的日程信息
procedure getschedulebyid(in_id in scott.task.task_id%type,rdata out pa_rcgl.mycursor);
--返回除“作息”类型外的所有未完成事件
procedure getunfinishedschedule(rdata out pa_rcgl.mycursor);
--添加新日程记录
procedure insertnewschedule(in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type);
--根据输入的日程信息来进行修改
procedure modifyschedule(in_id in scott.task.task_id%type,
in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type); --删除指定日程ID的日程信息
procedure delschedulebyid(in_id in scott.task.task_id%type);
end;
--个人日程管理程序包,包体scott.pa_rcgl
create or replace package body scott.pa_rcgl as --返回所有优先级的记录集
procedure filltaskprioritybox(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.priority;
end; --返回所有日程类型的记录集
procedure filltasktypebox(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.tasktype;
end; --返回所有日程
procedure getallschedule(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task;
end; --返回指定日期的日程,输入参数是希望查看的日期,输出参数是当天所有日程
procedure getschedulebyid(in_date in date,rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task
where begintime=in_date
order by begintime;
end; --返回指定日程ID的日程信息
procedure getschedulebyid(in_id in number,rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task
where task_id=in_id;
end; --返回除“作息”类型外的所有未完成事件
procedure getunfinishedschedule(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task
where type<>1 and finished=0;
end; --添加新日程记录(使用了序列)
procedure insertnewschedule(in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type) as
begin
insert into scott.task(task_id,title,detail,begintime,neednotify,notifytime,finished,type,priority)
values(scott.task_id_xl.nextval,in_title,in_detail,in_begintime,in_neednofity,in_notifytime,in_finished,in_type,in_priority);
commit;
end; --根据输入的日程信息来进行修改
procedure modifyschedule(in_id in scott.task.task_id%type,
in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type) as
begin
update scott.task set title=in_title,detail=in_detail,begintime=in_begintime,neednotify=in_neednotify,notifytime=in_notifytime,finished=in_finished,type=in_type,priority=in_priority where task_id=in_id;
commit;
end;
--删除指定日程ID的日程信息
procedure delschedulebyid(in_id in number) as
begin
delete from scott.task where task_id=in_id;
commit;
end; end;
在sqlplus worksheet中运行,报告“创建的包带有编译错误”,本人能力有限找不到问题,希望高手帮下忙。
create or replace package scott.pa_rcgl as
--声明引用游标类型
type mycursor is ref cursor;
--返回所有优先级的记录集
procedure filltaskprioritybox(rdata out pa_rcgl.mycursor);
--返回所有日程类型的记录集
procedure filltasktypebox(rdata out pa_rcgl.mycursor);
--返回所有日程
procedure getallschedule(rdata out pa_rcgl.mycursor);
--返回指定日期的日程,输入参数是希望查看的日期,输出参数是当天所有日程
procedure getschedulebyid(in_date in date,rdata out pa_rcgl.mycursor); --返回指定日程ID的日程信息
procedure getschedulebyid(in_id in scott.task.task_id%type,rdata out pa_rcgl.mycursor);
--返回除“作息”类型外的所有未完成事件
procedure getunfinishedschedule(rdata out pa_rcgl.mycursor);
--添加新日程记录
procedure insertnewschedule(in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type);
--根据输入的日程信息来进行修改
procedure modifyschedule(in_id in scott.task.task_id%type,
in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type); --删除指定日程ID的日程信息
procedure delschedulebyid(in_id in scott.task.task_id%type);
end;
--个人日程管理程序包,包体scott.pa_rcgl
create or replace package body scott.pa_rcgl as --返回所有优先级的记录集
procedure filltaskprioritybox(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.priority;
end; --返回所有日程类型的记录集
procedure filltasktypebox(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.tasktype;
end; --返回所有日程
procedure getallschedule(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task;
end; --返回指定日期的日程,输入参数是希望查看的日期,输出参数是当天所有日程
procedure getschedulebyid(in_date in date,rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task
where begintime=in_date
order by begintime;
end; --返回指定日程ID的日程信息
procedure getschedulebyid(in_id in number,rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task
where task_id=in_id;
end; --返回除“作息”类型外的所有未完成事件
procedure getunfinishedschedule(rdata out pa_rcgl.mycursor) as
begin
open rdata for
select * from scott.task
where type<>1 and finished=0;
end; --添加新日程记录(使用了序列)
procedure insertnewschedule(in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type) as
begin
insert into scott.task(task_id,title,detail,begintime,neednotify,notifytime,finished,type,priority)
values(scott.task_id_xl.nextval,in_title,in_detail,in_begintime,in_neednofity,in_notifytime,in_finished,in_type,in_priority);
commit;
end; --根据输入的日程信息来进行修改
procedure modifyschedule(in_id in scott.task.task_id%type,
in_title in scott.task.titled%type,
in_detail in scott.task.detail%type,
in_begintime in scott.task.begintime%type,
in_neednotify in scott.task.neednotify%type,
in_notifytime in scott.task.notify%type,
in_finished in scott.task.finished%type,
in_type in scott.task.type%type,
in_priority in scott.task.priority%type) as
begin
update scott.task set title=in_title,detail=in_detail,begintime=in_begintime,neednotify=in_neednotify,notifytime=in_notifytime,finished=in_finished,type=in_type,priority=in_priority where task_id=in_id;
commit;
end;
--删除指定日程ID的日程信息
procedure delschedulebyid(in_id in number) as
begin
delete from scott.task where task_id=in_id;
commit;
end; end;
在sqlplus worksheet中运行,报告“创建的包带有编译错误”,本人能力有限找不到问题,希望高手帮下忙。
一下看看错在哪儿
update scott.task set title=in_title,detail=in_detail,begintime=in_begintime,neednotify=in_neednotify,notifytime=in_notifytime,finished=in_ finished,type=in_type,priority=in_priority where task_id=in_id;
commit;
end;有两个这样的地方断开了
希望你成功!!!
或者等待高手!
错误的话再show errors
File->New->Program Window->Procedure创建存储过错,编译有错误就应该报出来的