Quote this big:
Http://www.cnblogs.com/lovemoon714/archive/2012/02/29/2373780.html
1. Concept and use
Similar to a custom type in C, you can use it to define a field collection for a table.
Defines the format type Recordname is Record (
Field Name field type,
Field Name field type
);
Use steps: 1) to declare struct 2) to define struct-body variable 3) to use.
2. Example:
--using a record in an anonymous block can also be defined in procedures, functions, and packages. Declare --declaring struct bodiesType Re_stu isrecord (Rname student.name%Type--separate the middle with commasRage Student.age%Type--last field is not signed);--End with a semicolon --defining struct-body variablesRw_stu Re_stu; cursorC_stu is SelectName,age fromstudent;begin OpenC_stu; LoopFetchC_stu intoRw_stu;--using struct-body variables Exit whenC_stu%NotFound; Dbms_output.put_line ('name ='||Rw_stu.rname||'age ='||rw_stu.rage); EndLoop; CloseC_stu; End;
ORACLE custom Structure (Record)