当前位置:首页 >时尚 >Oracle存储过程的创建 本人是过程Oracle 的热捧者

Oracle存储过程的创建 本人是过程Oracle 的热捧者

2024-06-30 20:46:44 [百科] 来源:避面尹邢网

Oracle存储过程的存储创建

作者:佚名 数据库 Oracle 本文主要介绍的是Oracle存储过程中的一些项目的介绍,其中包括Oracle储存过程的过程创建,以及判断语句等相关内容的存储描述。

本人是过程Oracle 的热捧者,以下的存储相关内容主要是我个人对于Oracle存储过程的一个总结,其中包括储存过程的过程创建,以及变量赋值的存储实际应用,以下就是过程文章的具体内容的描述,希望你会有所收获。存储

1、过程创建存储过程

Oracle存储过程的创建 本人是过程Oracle 的热捧者

 

Oracle存储过程的创建 本人是过程Oracle 的热捧者

  1. create or replace procedure test
    (var_name_1 in type,存储var_name_2 out type) as  

声明变量(变量名 变量类型)

Oracle存储过程的创建 本人是过程Oracle 的热捧者

 

  1. begin  

Oracle存储过程的执行体

 

  1. end test;  

打印出输入的时间信息

 

  1. E.g:   
  2. create or replace procedure test(workDate in Date) is   
  3. begin   
  4. dbms_output.putline('The input date is:'
    ||to_date(workDate,'yyyy-mm-dd'));   
  5. end test;   

 

2、变量赋值

变量名 := 值;

 

  1. E.g:   
  2. create or replace procedure test(workDate in Date) is   
  3. x number(4,过程2);   
  4. begin   
  5. x := 1;   
  6. end test;   

 

3、判断语句

if 比较式 then begin end; end if;

 

  1. E.g   
  2. create or replace procedure test(x in number) is   
  3. begin   
  4. if x >0 then   
  5. begin   
  6. x := 0 - x;   
  7. end;   
  8. end if;   
  9. if x = 0 then   
  10. begin   
  11. x: = 1;   
  12. end;   
  13. end if;   
  14. end test;   

上述的存储相关内容就是对Oracle存储过程总结的描述,希望会给你带来一些帮助在此方面。过程

【编辑推荐】

  1. 用触发器实现Oracle操作日志
  2. Oracle数据库中经常使用的存储启动方式介绍
  3. Oracle数据库中3种常用的关闭方式
  4. Oracle11g认证考试的3个主要途径
  5. Oracle SQL的优化的规则描述

 

责任编辑:佚名 来源: 博客园 Oracle存储过程

(责任编辑:热点)

    推荐文章
    热点阅读