oracle学习之第一个存储过程:打印Hello World
2017-06-09 20:56
295 查看
数据库对象:表、视图、索引、序列、同义词、存储过程、存储函数
存储过程:指的是存储在数据库中供全部用户程序调用的子程序叫存储过程、存储函数
存储过程和存储函数的同样点:完毕特定功能的程序
存储过程和存储函数的差别:是否用return语句返回值(存储函数能够,可是存储过程不行)
--第一个存储过程:打印Hello World /* 调用存储过程2种方式: 1、exec sayhelloworld(); 2、begin sayhelloworld(); sayhelloworld(); end; / */ create or replace procedure sayhelloworld --假设这个存储过程存在就replace替换否则create创建,这里创建无參数的存储过程 as --不可省略 begin dbms_output.put_line('Hello World');--注意不是双引號而是单引號,否则调用存储过程会报错 end; /
在dos窗体连接oracle数据库方式:sqlplus username/password@127.0.0.1:1521/orcl。或者直接打开sql plus输入username和password
SQL> set serveroutput on
SQL> exec sayhelloworld();
或者:
SQL>begin
sayhelloworld();
sayhelloworld();
end;
/
相关文章推荐
- oracle学习之第一个存储过程:打印Hello World
- c# .net 调用oracle存储过程学习例子
- Oracle 存储过程学习笔记(二)
- Oracle 存储过程发送邮件实例学习
- oracle 存储过程学习感悟
- oracle 数据库不用了,改用SQL,要学SQL了,第一个手工写的存储过程
- Oracle 的存储过程及游标(又学习)
- Oracle存储过程学习 (转)
- [跟着hsp步步学习系统]oracle培训学习集锦全360度扫描(10)一个分页存储过程
- oracle学习-存储过程返回一个值,和返回一个结果集
- Oracle 学习笔记13 —— 存储过程
- [转载]Oracle存储过程学习
- oracle 存储过程的学习
- oracle存储过程学习收集|韩顺平oracle视频教程|
- 【Oracle 学习笔记】Day 3 存储过程及函数
- 数据牵移,存储过程的学习(mysql到oracle)
- oracle 存储过程和函数学习笔记
- oracle 存储过程学习笔记
- Oracle学习总结(一)存储过程基础
- oracle存储过程学习经典[语法+实例+调用]