`
wilent
  • 浏览: 38814 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

PL/SQL入门系列--集合之:可变数组

SQL 
阅读更多
          本文向你介绍集合的:可变数组.
          可变数组的访问与嵌套表,index-by表访问类似.
          一. 定义语法
         TYPE type_name IS {VARRAY | VARYING ARRAY} (maximum_size) OF element_type[NOT NULL];
          二.示例
          1. number类型.
         
sql 代码
 
  1. Declare   
  2.     Type numbers Is Varray(20) Of Number(3);  
  3.     null_list numbers;  
  4.     list1 numbers := numbers(1,2);  
  5.     list2 numbers := numbers(Null);  
  6. Begin  
  7.      If null_list Is Null Then   
  8.      dbms_output.put_line('null_list 为空');  
  9.      End If;  
  10.        
  11.      If list2(1) Is Null Then   
  12.      dbms_output.put_line('list2(1) 也为空');  
  13.      End If;  
  14. End;  

   
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics