Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacement

by Madams (Pilgrim)
on Feb 06, 2007 at 02:44 UTC ( [id://598468]=note: print w/replies, xml ) Need Help??


in reply to Re: plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacement
in thread plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacement

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.

Replies are listed 'Best First'.
Re^3: plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacement
by jplindstrom (Monsignor) on Feb 06, 2007 at 13:27 UTC
    Ah, yes, I was only talking about the nvl vs coalesce thing :)

    Maybe not that obvious since the rest of the post wasn't about that. Sorry about the confusion.

    /J

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://598468]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-03-29 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found