oracle建包,函数demo

create table BOOK
(
  BOOK_ID   NUMBER(10),
  BOOK_NAME VARCHAR2(10)
);

create or replace package chen_pack
is
    function f__getBOOK_NAME_number(in_status in varchar2) return number;
end;

create or replace package body chen_pack
as
 
    function f__getBOOK_NAME_number(in_status in varchar2)
     return number
     as
         outnum number;
     begin
         select count(1) into outnum from test1.BOOK g where g.BOOK_NAME = in_status;
     return outnum;
    end f__getBOOK_NAME_number;
 
end;
 

  

posted @ 2018-08-13 14:17  酸奶加绿茶  阅读(428)  评论(0编辑  收藏  举报