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 -> Internal Function Call within a SELECT statement

Internal Function Call within a SELECT statement

From: Kevin Bass <akil1_at_mindspring.com>
Date: Fri, 31 Jul 1998 14:56:44 -0400
Message-ID: <6pt4av$lh0$1@camel29.mindspring.com>


I am attempting to call an internal function from within a select statement. I can perform this task if the function is stored within the database but I cannot seem to perfom the same task with the internal function. How can I call my internal function within the select statement (below)? Does the function have to be within the databse to perform this task?

declare

  my_govt_id varchar2(35);

  function get_govt_id( v_person_id in varchar2 ) return varchar2   is
    l_govt_id varchar2(35);
  begin
    select govt_id

      into l_govt_id
      from people
     where people_id = v_person_id;

    return( l_govt_id );
  end;

begin

    select get_govt_id( '&&1' )

      into my_govt_id
      from dual;

    dbms_output.put_line( 'Govt_id for person ' || '&&1' || ' is ' ||
              my_govt_id || '.' );

end;
/
show errors

Thank you in advance for your cooperation.

Kevin Received on Fri Jul 31 1998 - 13:56:44 CDT

Original text of this message

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