CREATE OR REPLACE TYPE rec_emp AS OBJECT (
empno NUMBER, -- scott.emp.empno%TYPE GEHT NICHT !
ename VARCHAR2(10),
sal NUMBER,
deptno NUMBER
);
/ CREATE OR REPLACE FUNCTION f ( v IN NUMBER) RETURN rec_emp IS r rec_emp;
BEGIN SELECT empno, ename, sal, deptno
INTO
r.empno, r.ename,r.sal,r.deptno -- v_rec_emp geht nicht
FROM scott.emp
WHERE empno=v;
RETURN r;
END;
/
show errors