Quote:
Originally Posted by
bongo
great, it's working that way
...
Yes, but I do hope you understand it still is not a good way of doing things.
- You should remove that OUT parameter from the function, because it is useless.
- Remove the 2nd parameter since it is never used inside your function.
- And once you do your DML stuff, you can return the hard-coded value 0 on success.
- Also capturing "when others then" will only suppress the line number that threw the exception. A better way is to capture only
named exceptions, or the ones that you
expect. If you are unsure of the exceptions that will be thrown, then leave out "when others then" and let Oracle do the escalation part for you. The resultant diagnostic information will be much more useful than what you have now.
Quote:
also a question...
what if $procedure points to a wrong proc. name?
how could I put begin.. exception..end block in this code?
[/quote]
You cannot put that in a begin...end block.
Invocation of procedure is in the sqlplus environment itself.
And the "ORA-" message is returned to the sqlplus environment.
The begin...end block does not even come into play in this scenario.
tyler_durden