Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by jplindstrom (Monsignor)
on Feb 01, 2007 at 14:17 UTC ( [id://597747]=note: print w/replies, xml ) Need Help??


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

coalesce is actually supported by Oracle, and since it is the standard way to do it, that's the one I prefer to use whenever possible.
  • Comment on Re: plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacement

Replies are listed 'Best First'.
Re^2: plperl RFC: (perl embedded in postgreSQL) An Oracle decode replacement
by Madams (Pilgrim) on Feb 06, 2007 at 02:44 UTC
    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.

      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://597747]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found