An Anonymous reader who is part of a team that works for a small company, maintaining a messy codebase of a large and expensive company writes, "We were having trouble finding why a particular PL/SQL Stored Procedure was failing. Inside the SP, we found the following:
IF .. AND p_program_name <> '[executable name].exe'
THEN RAISE invalid_calling_pgm; END IF;
"Yes, the stored procedure is actually checking the filename of the program it's being called from, apparently because the client wanted that particular stored procedure to do something completely different when called from a different source. We overlook it, since it has the correct filename, and go back to scratching our heads."
"Ten minutes later, a co-worker comes back to me and announces that he has found out why it fails. He has realised that when running the code in debug mode - or from the IDE at all - the exe name is prepended by .vshost.exe ... and hence the DB call bails."
"Yes, folks, our database code is not only dependant on the filename of the main client project executable but, because of this, follows a totally differnet code path when run from the IDE."