开始
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
结束