Oracle 사용자 정의 구조(레코드)

2649 단어 Oacle
1.개념 및 사용
     C 와 같은 사용자 정의 형식 으로 표 의 필드 집합 을 정의 할 수 있 습 니 다. 
       정의 형식  type recordName is Record(                         필드 이름 필드 형식,                         필드 이름 필드 종류                     );
       사용 절차:1)성명 구조 체   2)구조 체 변 수 를 정의 하 는 3)사용.
2.예:
--       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;

좋은 웹페이지 즐겨찾기