Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Function Construction. Help!
I want to construct a simple function that returns the reference to an
object, with a parameter being 'name'. The error that I get is
undocumented in the installatino cd that I have. Does anyu body have an
idea why I get this error? THanks.
SQL> select REF(d) from departments d where d.Name = 'Computer Science' 2 /
REF(D)
SQL> create or replace function get_dref (name IN VARCHAR) RETURN REF
department IS
2 d_ref REF department;
3 begin
4 select REF(d) into d_ref from departments d where d.Name = name;
5 end get_dref;
6 /
Function created.
SQL> SELECT get_dref('Computer Science') FROM DUAL
2 /
SELECT get_dref('Computer Science') FROM DUAL
*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at "PTAPIA.GET_DREF", line 4 ORA-06512: at line 1
SQL>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Tue Jul 20 1999 - 12:38:40 CDT
![]() |
![]() |