Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Return Value for a stored procedure
"Florian Marinoiu" <x_at_x.com> wrote in message news:3F9718E6.D8C03D67_at_x.com...
> Hi,
>
> In MSSQL Server developement I used the return value of a stored
> procedure to test for different things.
>
> Is it a similar mechanism in ORACLE 8.1
>
> Let's say that in a procedure after the commit I do a RETURN 0 and if an
> error occurs in the exception section I do a RETURN -1..
>
>
> Thanks,
> Florian
>
Florian,
It would save you a great deal of time and effort if you first read the documentation for Oracle before embarking on your assignment. If you don't do it, you would find your asking for help on each and every step and learning barely anything in the process. You can start with concepts manual and go on to read pl/sql guide .... etc.
Grab a book on Oracle Basics (I'd suggest the Beginning Oracle Programming by Sean Dillon, Tom Kyte, Howard et all) to get a faster start.
For your particular issue you would do something like this:
create procedure xyz (out_status OUT NUMBER)
as
...
BEGIN
.....
out_status := 0;
EXCEPTION
WHEN OTHERS THEN
out_status := -1;
END xyz;
/
HTH
Anurag
Received on Wed Oct 22 2003 - 20:51:49 CDT