oracle--record、rowtype示例

record示例:
create or replace procedure pro_test_record(vid in varchar2) is
type userRow is record(
id t_user.id%type,
name t_user.name%type
);
realRow userRow;
begin
select id,name into realRow from t_user where id=vid;
dbms_output.put_line(realRow.id||','||realRow.name);
end pro_test_record;

rowtype示例:
create or replace procedure pro_test_rowType(vid in varchar2) is
userRow t_user%Rowtype;
begin
select * into userRow from t_user where id=vid;
dbms_output.put_line(userRow.id||','||userRow.name);
end pro_test_rowType;

你可能感兴趣的:(user)