Nice!
Kevin Ryan, December 21, 2004 - 2:12 pm UTC
It's a Crafty way to use existing facilities.
Seems a little bit rough around the edges though I must say.
... and if you want to exit abruptly and quietly
Gabe, December 21, 2004 - 2:15 pm UTC
"return;"
December 21, 2004 - 2:59 pm UTC
they were looking for the C equivalent of
exit(0);
-- just to terminate....
could be
Gabe, December 21, 2004 - 4:07 pm UTC
How do I abruptly exit a function with a single command?
?!?!?!?! ^^^^^^^^
Bit misleading there ... the mention of the loop did not help either!
December 21, 2004 - 7:11 pm UTC
<quote>
In other languages there are things like "EXIT" or "END" which will effectively
end a program.
</quote>
is the branch I grabbed onto and held....
No "when others" ?
Robert, December 21, 2004 - 6:34 pm UTC
Tom,
Inside "when others" we can configure our error message to send us useful debugging information such as...
1) Where in the program the error occurred (by populating a 'v_here' variable with the program location before calling SQL, etc.).
2) 'Key' values at the time of a SQL call to help in locating data on which error occurred (also by populating a 'v_what' type variable appropriatly).
We include all this info inside 'raise_application_error' including SQLERRM.
Is there a better way?
Regards,
Robert.
December 21, 2004 - 7:26 pm UTC
because 99.999999999999999999999999999999999999999999% of the time, the when others is not followed by RAISE; and the error gets silently ignored leading to heinous bugs.
The problem isn't when others so much as the developers using when others. they need to RE RAISE the error immediately -- but many times they do not, and bamm, instant bug.
I was counting on the when others to not be immediately followed by RAISE and hence this immediate exit would be an immediate "goto" instead.
Robert, December 22, 2004 - 9:32 am UTC