laziness, impatience, and hubris | |
PerlMonks |
Re^2: plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacementby Madams (Pilgrim) |
on Feb 06, 2007 at 02:44 UTC ( [id://598468]=note: print w/replies, xml ) | Need Help?? |
Actually "case x when bool then y when bool then z else zz end" is the standard compliant way to do oracle's decode
However I do like the "speed" and conciseness of the decode vs case. But as stated in the OP, I hacked this up to use for "work emulation". We use an ERP that uses Oracle 8i and the code base is littered with decodes, so to stop being asked to explain why my code doesn't "look like" the code from the ERP company's coders, I've just caved... In my own code that doesn't "touch" the database directly (in a spreadsheet "solution" (ick..) or personal utility query) I use case. Plus it was gobs of fun to write the plperlu script and find out how they set up the Safe container for plperl....
"All too often people confuse their being able to think with their actually having done so. A more pernicious mistake does not exist." --Moraven Tollo in Michael A. Stackpole's A Secret Atlas My Unitarian Jihad Name is: Sibling Pepper Spray of Loving Kindness. Get yours.
In Section
Seekers of Perl Wisdom
|
|