oracle:集合(二)
来源:互联网 发布:我的祖国 知乎 编辑:程序博客网 时间:2024/05/17 22:15
在PL/SQL中使用集合
1.PL/SQL集合方法
创建和使用多级集合
1.使用多级集合
create type t_varray_phone as varray(3) of varchar2(14);
create type t_address as object ( street varchar2(15), city varchar2(15), state char(2), zip varchar2(5), phone_number t_varray_address);
create type t_nested_table_address as table of t_address;
create table customer_with_nested_tabel ( id integer primary key, first_name varchar(10), last_name varchar(10), addresses t_nested_table_address)nested table addressesstore as nested_addresses;
Oracle Database 10g对集合的增强
1.关联数据
create procedure customers_associative_array as type t_assoc_array is table of number index by varchar2(15); v_customer_array t_assoc_array;begin v_customer_array('jason') := 32, v_customer_array('zoey') := 28; dbms_output.put_line(v_customer_array('jason')); dbms_output.put_line(v_customer_array('zoey'));end customers_associative_array;
2.更改元素类型的大小
alter type t_varray_addressmodify element type varchar2(60) cascade;
3.增加变长数组中元素的个数
alter type t_varray_addressmodify limit 5 cascade;
4.为嵌套表的存储表使用不同的表空间
create table cust_with_nested_tabel ( id integer primary key, first_name varchar(10), last_name varchar(10), addresses t_nested_table_address)nested table addressesstore as nested_addresses tablespace users;
5.嵌套表对ANSI的支持
函数:
阅读全文
0 0
- oracle:集合(二)
- ORACLE PL/SQL 集合学习笔记(二)
- 集合(二)
- 集合(二)
- 集合学习(二)
- 集合复习(二)
- 集合(二)
- Scala集合(二)
- 集合(二)
- 集合(二)
- 集合初探(二)
- java集合(二)
- 集合(二)
- Notification集合(二)
- 集合类(二)
- Java集合(二)
- Scala集合(二)
- Java集合(二)
- 解决react-native软键盘弹出挡住输入框的问题
- learn opencv-Ubuntu安装opencv3
- 六边形的代码画法
- pandas tips one
- TMS320F28377S开发过程中的常见问题
- oracle:集合(二)
- scala学习笔记-特质
- 数组中只出现一次的数字
- Mybatis基础---常用SQL映射标签、多参数设置、resultMap(自定义映射)
- Unity编辑器---创建对话框
- 抽象类和接口的异同
- Deep Neural Network for Image Classification:Application
- 单分支条件语句
- 计算1~n之间的所有的数的平方和立方 习题6.4