If you ever run across any of the following, apply the suggested cleanup, or contact the owner of the code, or run for the hills. And I am pretty sure many of my readers will have suggestions for other code that should never appear in your PL/SQL programs. Let me know in the comments and I will add them to the post (giving me all the credit of course - no, just joking! YOUR NAME will be bright lights. :-) ). Here's the list of things to avoid: DON'T set default values of variables to NULL. DON'T select from dual for....just about anything. DON'T declare the FOR loop iterator. DON'T trap NO_DATA_FOUND for inserts, updates and deletes. DON'T execute the same DML statement inside a loop. DON'T hide errors. DON'T re-raise an error without logging first. See below for the gory details. Set default value to NULL Whenever you declare a variable it is assigned a default value of NULL. So you should not explicitly provide NULL as a default v...
For the last twenty years, I have managed to transform an obsession with PL/SQL into a paying job. How cool is that?