当前位置: 移动技术网 > IT编程>数据库>Oracle > PL/SQL 用户自定义子类型

PL/SQL 用户自定义子类型

2018年08月28日  | 移动技术网IT编程  | 我要评论

有希知名,win8正式版激活,美国vps推荐

子类型具有与其基本类型相同的操作,但只有基本类型有效值的子集。

例如,pl/sql预先定义子类型characterinteger,如下所示:

subtype character is char; 
subtype integer is number(38,0);

并且,可以定义和使用自己的子类型:

declare 
   subtype name is char(20); 
   subtype message is varchar2(100); 
   salutation name; 
   greetings message; 
begin 
   salutation := 'reader '; 
   greetings := 'welcome to the world of pl/sql'; 
   dbms_output.put_line('hello ' || salutation || greetings); 
end; 

输出结果:
hello reader              welcome to the world of pl/sql

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网