--定义类型
create or replace type rd as object
(
id integer,
name varchar2(10)
)
--定义type body省略了;
--定义方法测试rd类型
create or replace function testrd return rd is
Result rd;
begin
Result:=rd(1,'aa'); --初始化Result
dbms_output.put_line(Result.name);
return(Result);
end testrd;