orcale存储过程学习之路--创建空存储过程(二)
--创建表
create table TESTTABLE
(
id1 VARCHAR2(12),
name VARCHAR2(32)
)
select t.id1,t.name from TESTTABLE t
insert into TESTTABLE (ID1, NAME)
values ('1', 'zhangsan');
insert into TESTTABLE (ID1, NAME)
values ('2', 'lisi');
insert into TESTTABLE (ID1, NAME)
values ('3', 'wangwu');
insert into TESTTABLE (ID1, NAME)
values ('4', 'xiaoliu');
insert into TESTTABLE (ID1, NAME)
values ('5', 'laowu');
//-------------------------- 声明部分 ------------------------
create or replace package PRO_TEST_TESTTABLE is
PROCEDURE Test_Count;
PROCEDURE Test_Pra(Name IN varchar2);
end PRO_TEST_TESTTABLE;
//-------------------------- body部分 ------------------------
create or replace package body PRO_TEST_TESTTABLE IS
PROCEDURE Test_Count IS
v_total number(1);
begin
null;
end test_count;
PROCEDURE Test_Pra(Name IN varchar2)IS
begin
null;
end Test_Pra;
end PRO_TEST_TESTTABLE;
调用:
declare
ret_code NUMBER;
begin
PRO_TEST_TESTTABLE.Test_Count;
end;