oracle-pl/sql之三

时间:2023-03-10 03:52:36
oracle-pl/sql之三

集合与记录

set serveroutput on
create or replace package my_types authid definer is
type my_rec is record (a number,b number);
function init_my_rec return my_rec;
end my_types;
/ create or replace package body my_types is
function init_my_rec return my_rec is
rec my_rec;
begin
rec.a :=6;
rec.b :=8;
return rec;
end init_my_rec;
end my_types;
/ declare
r constant my_types.my_rec :=my_types.init_my_rec();
begin
dbms_output.put_line('r.a= '||r.a);
dbms_output.put_line('r.b= '||r.b);
end;
/