Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: returning the value of a variable...?
A copy of this was sent to "Jason K McCann" <jkm_at_reclaimtech.com>
(if that email address didn't require changing)
On Tue, 11 May 1999 11:37:53 -0400, you wrote:
>In Oracle8 I simply need to return the value of a variable - how do I do
>that in a test run of my code? I'm coming from T-SQL where, if I had
>declared a variable named @v_somenumber, I could issue a 'select
>@v_somenumber' and I would have its value returned. How do I do that in
>PL/SQL?
>
>TIA
>Jason K McCann
>jkm_at_reclaimtech.com
>
>
create or replace procedure my_procedure( p_somenumber OUT number )
as
begin
...
p_somenumber := 5;
end;
or
create or replace function my_function return number
as
l_somenumber number;
begin
....
return l_somenumber;
end;
or, if you want to return it as a result set, you would use a REF CURSOR and return it after opening the query "open your_ref_cursor as select l_somenumber from dual;"
See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'...
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed May 12 1999 - 10:01:26 CDT
![]() |
![]() |