Jump to content


Click the link below to see the new game I'm developing!


Photo
- - - - -

Oracle and Procedure and Parameters


2 replies to this topic

#1 red

red

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 08 November 2006 - 10:09 AM

Hi all,
i have a problem,
I have procedure in oracle with one parameter in input and one parameter in output.

Example:

create or replace procedure prova_proiv(p_in in varchar2, p_out out varchar2) is
begin
if nvl(p_in, [email=""]'@'[/email]) = 'A' then
p_out:='0';
else
p_out:='1';
end if;
end prova_proiv;


In proiv how can receive a parameters?

$PAR1 = 'C'
$PAR2 = ''
SQL
DECLARE PAR VARCHAR2(1) :=:$PAR1;
DECLARE TOR VARCHAR2(1) :=:$PAR2;
BEGIN
CALL PROVA_PROIV(PAR,TOR);
END;
ENDSQL

UMSG('$PAR1:' + $PAR1 + '-' + $PAR2,-1)


REGARDS IN ADVANCE
RED

#2 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 372 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

Posted 08 November 2006 - 03:15 PM

use a function instead to return the value. or wrap the procedure in
a function. Then you can use it in SELECT statement.
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.

#3 red

red

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 12 November 2006 - 09:15 AM

thanks

therefore with a "select" is a unique solution to use an store procedure parameters output ?

there is a another solution using a sql function or package....



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Click the link below to see the new game I'm developing!