[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

oracle case

Posted on 2011-03-08
4
Medium Priority
?
338 Views
Last Modified: 2012-05-11
This sentence makes my web application to fall, this case right?
CASE LineaCredVencimiento
            WHEN TO_DATE('01/01/1900','DD/MM/YY') THEN null
            WHEN null THEN null
            ELSE LineaCredVencimiento
            end LineaCredVencimiento
0
Comment
Question by:enrique_aeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 77

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 248 total points
ID: 35071984
What is failing?

You do not need the when null then null since the ELSE passed back whatever it is.
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 504 total points
ID: 35071989
the case itself is fine

depends how you use it

if you try to run that as a standalone statement it will fail.
if you select that case from some table with the LineaCredVencimiento column it should work.
if you try to assign that to a pl/sql variable it will fail.


0
 
LVL 3

Assisted Solution

by:CarlsbergFTW
CarlsbergFTW earned 248 total points
ID: 35071992
The case is correct , it returns null if the LineaCredVencimiento column contains '01/01/1900'
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 504 total points
ID: 35072015
WHEN null THEN null

doesn't work at all anyway, if you pass in NULL the WHEN condition will fail because

NULL is NOT equal to NULL  (NULL = NULL is false)
it's also not NOT equal to NULL  (NULL != NULL is false)


so it will appear to work because of the ELSE clause as stated by slightwv

it's safe to do, but not in the way you might think
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question