type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;什么意思?declare type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;begin select * into var_temp(1) from s_emp where id =1;
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 20:18:23
type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;什么意思?declare type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;begin select * into var_temp(1) from s_emp where id =1;
type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;什么意思?
declare
type table_t id table of s_emp%rowtype index by binary_integer;
var_temp table_t;
begin
select * into var_temp(1) from s_emp where id =1;
select * into var_temp(2) from s_emp where id =2;
select * into var_temp(30) from s_emp where id =3;
for a in 1..3 loop
dbms_output.put_line(var_temp(a).id||':'||var_temp(a).last_name);
end loop;
end;
type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;什么意思?declare type table_t id table of s_emp%rowtype index by binary_integer; var_temp table_t;begin select * into var_temp(1) from s_emp where id =1;
1.DECLARE 说明以下你要声明的部分
2.Type 声明是类型 table_t 类型的名字
3.IS TABLE OF 指定是一个集合的表的数组类型,简单的来说就是一个可以存储一列多行的数据类型 ,my_emp 指出在哪个表上( 存在的表 ) %ROWTYPE 指在表上的行的数据类型.
4.INDEX BY BINARY_INTEGER 指索引组织类型
5.var_temp 定义一个变量来存储集合数据类型