数据库函数和存储过程的包—创建包.pptVIP

  • 8
  • 0
  • 约1.1万字
  • 约 38页
  • 2019-08-19 发布于广东
  • 举报

数据库函数和存储过程的包—创建包.ppt

数据库函数和存储过程的包 创建包(package) 函数: create or replace package 包名 as 函数 注意:as后可加多个函数 存储过程: Create or replace package 包名 as 存储过程 注意:as后可加多个存储过程 函数的包调用: call 包名.函数名; 存储过程的包调用: call 包名.存储过程名; 包的调用 无参数存储过程 --无参数存储过程 create procedure stu_proc1 as p_name varchar2(32); begin select sname into p_name from stu where sno=001; dbms_output.put_line(p_name); end; call stu_proc1(); --调用方法一 ? 带有输入参数的存储过程 --仅仅带有输入参数的存储过程 create procedure stu_proc2(pno in stu.sno%type) as pname varchar2(30); begin select sname into pname from stu where sno=pno; dbms_output.put_line(pname); end;

文档评论(0)

1亿VIP精品文档

相关文档