AW: Return Code For PL/SQL Function

AW: Return Code For PL/SQL Function

 

  

Why should you resort to status/error codes? I'll never understand, why
some "professional" does recommend something like that! PL/SQL supports the
keyword EXCEPTION. If you've got to handle error conditions imho you
should never use status codes as RETURN xxx for failure YYY for success.
Instead, if your code runs into some failure throw an exception - they've
been made to be able to forget about stupid error codes, which only will get
confused over time.

As for returning more than one value from a function (i.e. a string AND your
error code), well, basically you can't. But PL/SQL supports IN, IN OUT and
OUT parameters. OUT parameters are variables which are passed by reference,
so you'll be able to "return" more than one value.

Regards,

gerald

-----Ursprüngliche Nachricht-----
Von: MurliB826
[mailto:oracledba-ezmlmshield-x86965548.[Email address protected]
Gesendet: Sunday, November 14, 2004 12:37 PM
An: LazyDBA Discussion
Betreff: Return Code For PL/SQL Function


I have been asked to write PL/SQL best practices and during the review of
these practices someone suggested that I should return retrun code of 0 for
success and 1 for fail. I think this is not possible because, if you were to
expect
a value that is a varchar2 to be returned, you return more than one value to

the calling program.

I will appreciate anyhelp I can get on this.

Thanks,
Michael


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page