Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: VERY quick question for the masters...

Re: VERY quick question for the masters...

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 21 Jul 1999 15:58:43 GMT
Message-ID: <7n4qnj$knk$1@nntp.csufresno.edu>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US