(挂号查询)
create or replace procedure everyday_select_proc(
p_number in everyday.day_in_id%type,
p_name out everyday.name%type,
p_age out everyday.age%type,
p_sex out everyday.sex%type,
p_date out everyday.in_date%type,
p_dept out everyday.dept_no%type)
is
begin
select name,sex,age,in_date,dept_no
into p_name,p_sex,p_age,p_date,p_dept
from everyday
where day_in_id=p_number;
end everyday_select_proc;
(删除)
create or replace procedure everyday_delete_proc(
p_number everyday.day_in_id%type)
is
begin
delete
from everyday
where day_in_id=p_number;
end everyday_delete_proc;
(挂号)
create or replace procedure everyday_insert_proc(
p_no out everyday.day_in_id%type,
p_name everyday.name%type,
p_sex everyday.sex%type,
p_age everyday.age%type,
p_oper everyday.oper_no%type,
p_class everyday.class%type,
p_dept everyday.dept_no%type,
p_ghf everyday.ghf%type)
is
begin
insert into everyday
values(day_in_id_seq.nextval,p_name,p_sex,p_age,p_oper,default,p_class,p_dept,p_ghf);
select day_in_id_seq.currval
into p_no
from dual;
end everyday_insert_proc;
CREATE SEQUENCE "DAY_IN_ID_SEQ" INCREMENT BY 1 START
WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE
CACHE 20 NOORDER
(12.25 缴费)
create or replace procedure sick_insertcost_proc(
p_sheet_no out sick.sheet_no%type,
p_number sick.day_in_id%type,
p_code sick.cost_code%type,
p_type sick.cost_type%type,
p_cost sick.cost%type,
p_dept sick.dept_no%type,
p_oper sick.oper_no%type)
is
begin
insert into sick
values(sheet_no_seq.nextval,p_number,p_code,p_type,p_cost,DEFAULT,p_dept,p_oper,DEFAULT,DEFAULT,DEFAULT);
select sheet_no_seq.currval
into p_sheet_no
from dual;
end sick_insertcost_proc;
CREATE SEQUENCE "SHEET_NO_SEQ" INCREMENT BY 1 START
WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE
CACHE 20 NOORDER
(12.25查询)
create or replace procedure sick_select_proc(
p_sheet_no sick.sheet_no%type,
p_number out sick.day_in_id%type,
p_code out sick.cost_code%type,
p_type out sick.cost_type%type,
p_cost out sick.cost%type,
p_dept out sick.dept_no%type,
p_oper out sick.oper_no%type)
is
begin
select day_in_id,cost_code,cost_type,cost,dept_no,oper_no
into p_number,p_code,p_type,p_cost,p_dept,p_oper
from sick
where sheet_no=p_sheet_no;
end sick_select_proc;
(12.25删除)
create or replace procedure sick_delete_proc(
p_sheet_no sick.sheet_no%type)
is
begin
delete
from sick
where sheet_no=p_sheet_no;
end sick_delete_proc;
(12.25退票)
create or replace procedure sick_back_proc(
p_sheet_no sick.sheet_no%type)
is
begin
update sick
set back_mark='1'
where sheet_no=p_sheet_no;
end sick_back_proc;
(12.23统计)
create or replace procedure oper_total_proc(
p_handin_date in sick.handin_date%type,
p_oper_no in sick.oper_no%type,
p_sum_cost out sick.cost%type)
is
begin
select sum_cost
into p_sum_cost
from sick_oper_view
where handin_date=p_handin_date and oper_no=p_oper_no;
end oper_total_proc;
(数据转移)
create or replace procedure data_transfer_proc
is
begin
insert into everydayhistory
select *
from everyday;
insert into sickhistory
select *
from sick;
end data_transfer_proc;
评论1