PLSQL中的RECORD小例子

开始

SET SERVEROUTPUT ON;

DECLARE
  
  TYPE emp_record_type IS RECORD
  ( empno emp.empno%TYPE,
    empname emp.ename%TYPE);
  
  emp_record emp_record_type;
  
BEGIN

  emp_record.empno:=10;
  emp_record.empname:='TEST';
  
  dbms_output.put_line('empno: '||emp_record.empno ||' empname: ' || emp_record.empname);
  
END;
/

运行结果:

anonymous block completed
empno: 10 empname: TEST

结束

posted @ 2012-11-14 10:27  健哥的数据花园  阅读(3335)  评论(0编辑  收藏  举报