当前位置:Gxlcms > 数据库问题 > Oracle 自定义结构(Record)

Oracle 自定义结构(Record)

时间:2021-07-01 10:21:17 帮助过:3人阅读

在匿名块中使用record,也可定义在过程、函数、包中。 declare --声明结构体 type re_stu is record( rname student.name%type, --中间用逗号分开 rage student.age%type --最后一个字段没有符号 ); --以分号结束 --定义结构体变量 rw_stu re_stu; cursor c_stu is select name,age from student; begin open c_stu; loop fetch c_stu into rw_stu; --使用结构体变量 exit when c_stu%notfound; dbms_output.put_line(姓名=||rw_stu.rname|| 年龄=||rw_stu.rage); end loop; close c_stu; end;

 

Oracle 自定义结构(Record)

标签:

人气教程排行