函数与存储过程.pptVIP

  • 1
  • 0
  • 约6.4千字
  • 约 25页
  • 2021-11-04 发布于广东
  • 举报
函数与存储过程 第一页,共25页 8.1 函数 函数是Oracle数据库中常用对象之一,与其他编程语言的函数一样,Oracle中的函数也必须返回一个值。这也是函数区别于存储过程的重要特征。 第二页,共25页 8.1.1 函数简介 1.函数与功能的划分 2.函数的参数 3.函数的返回值 第三页,共25页 8.1.2 创建函数 1.创建函数 create or replace function get_hello_msg return varchar2 as begin return hello world; end get_hello_msg; 2.在数据字典中查看函数的信息 select object_name, object_type, status from user_objects where lower(object_name) = get_hello_msg 3.查看函数的返回值 set serverout on; declare msg varchar2(20); begin msg := get_hello_msg; dbms_output.put_line(msg); end; 第四页,共25页 8.1.3 函数中的括号 其他标准编程语言中,函数的括号都是必需的,但是函数get_hello_msg并没有使用小括号。当函数需

文档评论(0)

1亿VIP精品文档

相关文档