Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 31 Jul 2003 @ 20:42:52 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: CONVERTING NULLS
 
From:   Jim Downey

I can't logon right now so I probably have the exact syntax wrong, but does this do what you need?

It sets the column to be the column value unless it is null, then it sets the default you defined in your original script.

UPDATE td_table
   SET RECORD_ID   = coalesce(RECORD_ID,' ')
   ,   PROCESS_NUM = coalesce(PROCESS_NUM,0)
   ,   DATE_FILLED = coalesce(DATE_FILLED,DATE '0001-01-01')
 WHERE RECORD_ID is NULL
    OR PROCESS_NUM is NULL
    OR DATE_FILLED is NULL
;


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023