dba培训教程:Oracle PL/SQL语法格式
PL/SQL是没命名的存储过程,函数,触发器,PL/SQL块的语法格式如下:
[declare]
--声明部分,可选
begin
--执行部分,必须
[exception]
--异常处理部分,可选
end
PL/SQL块每条语句必须用分号结束,单行注释--,多行注释/*...*/,下面是一个PL/SQL块例子
set serveroutput on
declare
--声明变量
a int := 1; --声明并且赋值
address varchar2(128);
mobilephone varchar2(20);
username varchar2(50);
begin
select address, mobilepone, usrename into address, mobilephone, username from orderinfo where orderid = 1
dbms_output.put_line('用户' || username || '的地址是' || address || '手机是' || mobilephone); --||字符连接运算符
exception
when others then
dbms_output.put_line('获取数据失败!');
end;
-
标签错误:<!-- #Label#
labelId=20160707140604
moduleId=1
classId=12231768634
orderby=2
fields=url,title,u_info
attribute=
datatypeId=22192428132
recordCount=3
pageSize=
<htmlTemplate><dt><img src="/images/index_26${index}.jpg" width="100" height="62" /><a href="$url" title="${title}">${title}</a><span>${api.left(u_info,60)}</span></dt></htmlTemplate>
-->
- 我要参加技术沙龙