--第一个存储过程:打印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
标签:返回值 sqlplus user return bsp username 函数 style 存储
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉 本文系统来源:http://www.cnblogs.com/cynchanpin/p/6973720.html