create or replace package lcp_archive
as
procedure lcp_archive_proc (check_id_var in number, status_var out varchar(1));
end lcp_archive;
create or replace package body lcp_archive
as
procedure lcp_archive_proc (check_id_var in number, status_var out varchar(1))
as
fee_var number;
closed_date_var date;
addedby_var varchar2(30);
amount_var number;
begin
select fee
,closed_date
,addedby
,amount
into fee_var
,closed_date_var
,addedby_var
,amount_var
from lc_check
where check_id = check_id_var;
insert into lc_check_archive values (check_id_var ,fee_var ,closed_date_var ,addedby_var ,amount_var);
delete from lc_check where check_id = check_id_var;
exception when (no_data_found)
then status_var := 'f';
else status_var := 't';
end lcp_archive_proc;
end lcp_archive;
begin
lcp_archive.lcp_archive_proc(12345,st_v);
dbms_output.put_line('status is'||st_v);
end