作业帮 > 英语 > 作业

type table_t id table of s_emp%rowtype index by binary_integ

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:英语作业 时间:2024/07/09 16:43:41
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_integ
1.DECLARE 说明以下你要声明的部分
2.Type 声明是类型 table_t 类型的名字
3.IS TABLE OF 指定是一个集合的表的数组类型,简单的来说就是一个可以存储一列多行的数据类型 ,my_emp 指出在哪个表上( 存在的表 ) %ROWTYPE 指在表上的行的数据类型.
4.INDEX BY BINARY_INTEGER 指索引组织类型
5.var_temp 定义一个变量来存储集合数据类型
再问: IS TABLE OF 指定是一个集合的表的数组类型, 简单的来说就是一个可以存储一列多行的数据类型。请问有没有存储多列多行的数据类型? INDEX BY BINARY_INTEGER 指索引组织类型,不理解啊 记的老师说这个与二进制有关系 dbms_output.put_line(var_temp(a).id||':'||var_temp(a).last_name); 这个显示的是上面三条数据的?
再答: 是的,你可以把它当成一个表,因为它也有行和列,也可以当面一个多维数组!