Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: VERY quick question for the masters...
In article <7n2sll$a76$1_at_nnrp1.deja.com>, <saks1000_at_my-deja.com> wrote:
>How can I make a function out of this statement?
>select REF(d) from departments d where d.Name = 'Computer Science'
What is REF(d)?
>PS This doesn't work:
>create or replace function get_dref (name IN VARCHAR) RETURN REF
>department IS
> d_ref REF department;
>begin
> select REF(d) into d_ref from departments d where d.Name = name; 5
>end get_dref;
Create or replace function get_dref(p_Name varchar2)
return varchar2 is
dref departments.ref%type;
cursor c is
select d.Ref from Departments d where d.Name = p_Name;
Begin
Open C; Fetch C into dref; Close C; Return dref;
End;
Received on Wed Jul 21 1999 - 10:58:43 CDT
![]() |
![]() |