Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CASE TO SET TIME TO NULL IF ITS CORRESPONDING DATE IS NULL

631922Jun 4 2011 — edited Jun 4 2011
How set date to null if its corresponding column time is null

CREATE TABLE test
(C_DATE AS DATE
C_TIME AS VARCHAR 2);
INSERT INTO test VALUES('15/01/2001,'18:10');
INSERT INTO test VALUES('20/01/2001,'22:10');
INSERT INTO test VALUES('','');
INSERT INTO test VALUES('','13:00');
INSERT INTO test VALUES('','11:00');
 select c_date, c_time,
              case 
                when (c_date is null and c_time is not null) then c_ars_time IS NULL  
               end 
               from test;
currently the case statement gets ora-00905: missing keyword. any ideas would be appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2011
Added on Jun 4 2011
4 comments
1,101 views