Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

error in executing the function

SmileJan 2 2009 — edited Jan 2 2009
hi I tried the following function , FUNCTION is creating fine but getting the error while executing...
SQL> create or replace FUNCTION getPmnOrgRow(empId emp.EMPNO%TYPE)
  2    RETURN EMP%ROWTYPE
  3    IS
  4    result EMP%ROWTYPE;
  5   BEGIN
  6    SELECT *
  7    INTO result
  8    FROM EMP
  9    WHERE EMPNO = empId;
 10    RETURN result;
 11   EXCEPTION
 12    WHEN NO_DATA_FOUND THEN
 13     raise_application_error(-20100,'error');
 14     RETURN NULL;
 15   END;
 16  /

Function created.

SQL> select getPmnOrgRow(7566) from dual;
select getPmnOrgRow(7566) from dual
       *
ERROR at line 1:
ORA-00902: invalid datatype
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2009
Added on Jan 2 2009
4 comments
1,214 views