-
Website
http://awads.net/wp/ -
Original page
http://awads.net/wp/2007/07/25/what-you-ought-to-know-about-case-in-oracle-plsql/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
jgarry
3 comments · 1 points
-
Andy C
22 comments · 47 points
-
dahowlett
1 comment · 2 points
-
Don Seiler
9 comments · 1 points
-
davidhaimes
4 comments · 3 points
-
-
Popular Threads
oh!
this was new to me the differnet behavior of a searched case expression and a statement.
Great
Karl
Nice post Eddie, it would be interesting; if i had any spare time..:-) to see if Duffs device would work with PL/SQL case contructs as they do with C.
cheers
Pete
Good one Eddie
Learned a new thing :)
Sidhu
Glad you learned something new guys. I also learned something new today thanks to Pete, the Duff's device. I had to check it out. Very interesting.
After my limited reading about it, and If I understand it correctly, I do not believe that Duff's device can be simulated in PL/SQL using CASE because there is no "break" in PL/SQL as there is in C. Moreover, unlike C, CASE breaks automatically at the end of a positive WHEN condition block (continues after the END CASE).
Now, there is this new feature in 11g, CONTINUE, but I do not see that it will make any difference in this case.
Seems like an unknown subtlety to even Tom:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:67073167580253
This article and the poster on asktom are talking about CASE in Oracle PL/SQL. Tom is only talking about CASE in Oracle SQL, where you never need the ELSE.
Bottom line is, you'll only get the CASE_NOT_FOUND exception when omitting the else clause from a case "statement" in PL/SQL.