pl/sql中record和%rowtype整理
1. 创建stu表,如下:
create table stu(s1 number, s2 number);
2. 定义多维数组, 能用来接受多条返回数据
方式一: type type_name is table of stu%rowtype; # 基于表中行类型的多维数组
custom_type type_name; # 定义该多维数组变量
execute immediate 'select * from stu where s1>:1' bulk collect into custom_type using in 5;
方式二: type list_name is record(x number, y number); # 先定义record, record即一维数组,
type type_name is table of list_name; # 使用定义的一维数组定义多维数组
custom_type type_name; # 定义该多维数组变量
execute immediate 'select * from stu where s1>:1' bulk collect into custom_type using in 5;
3. 定义一维数组, 用来接受一条返回数据
方式一: type list_name is record(x number, y number); # 先定义record, record即一维数组.
custom_type list_name #定义该一维数组变量.
execute immediate 'select * from stu where s1=:xx' into custom_type using in 1;
方式二: custom_type stu%rowtype; # 使用表的行类型定义一维数组变量
execute immediate 'select * from stu where s1=:xx' into custom_type using in 1;
最新文章
- python关于分割与拼接的那些事
- ArcGisEngineForJava开发
- VS2013 密钥 – 所有版本(Visual Studio Ultimate,Premium,Professional,TFS)
- Lucene.net站内搜索—2、Lucene.Net简介和分词
- Hadoop 之MongoDB
- 用JQuery给图片添加鼠标移入移出事件
- 使用UDEV绑定ASM多路径磁盘
- 在Win7下要通过某个 线程 来调用SavaDialog文件选择框的问题
- HW3.8
- 【Unity探究】物理碰撞实验
- SQL Server :理解DCM页
- poj 1328 Radar Installation (简单的贪心)
- Mirantis OpenStack 8.0 版本
- ASP.NET没有魔法——目录(完结)
- 主机名变成bogon?连不上mysql?你需要看下这篇文章
- 初识shell编程
- macbook突然没有声音了
- MySQL5.7 搭建主从同步
- sap 软件架构
- SSO单点登录_理解
热门文章
- Violet音乐社区 - 个人总结报告
- java根据value获取Map对象的key
- centos安装Redis和设置远程访问
- 使用SQL Server内存优化表 In-Memory OLTP
- 表单生成器(Form Builder)之mongodb表单数据查询——关联查询
- mysql windows 安装5.7
- java1.8 ConcurrentHashMap 详细理解
- Bit Manipulation-leetcode
- RocketMQ 升级到主从切换(DLedger、多副本)实战
- Linux配置部署_新手向(三)——MySql安装与配置