Thank you so much, It works!!

 


From: Lukas Eder [mailto:lukas.eder@gmail.com]
Sent: Monday, February 21, 2011 5:57 PM
To: Derby Discussion
Cc: Mamatha Kodigehalli Venkatesh
Subject: Re: Decode function as that in Oracle

 

Below query works in oracle.
Is there equivalent in Derby?
Update myTable set COL_1 = decode(COL_1,null,'Null', 'Mamatha') where key ='M9621'

 
In most SQL dialects, you can use the CASE statement, i.e. something like this

UPDATE myTable
SET COL_1 =
  (CASE WHEN COL_1 IS NULL THEN 'Null' ELSE 'Mamatha' END)
WHERE KEY = 'M9621'