Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 16 Aug 2002 @ 20:13:47 GMT


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


Subj:   CASE in Ins/Sel
 
From:   Anomy Anom

<-- Anonymously Posted: Friday, August 16, 2002 16:07 -->

Is this possible what I am trying to do? I am doing a ins/sel and sub-stringing the 4th position of a field to check the value. If equal to 'S' or 'N', then I want those values else I want it to be NULL.

INSERT INTO NEWTABLE
( SUBSTRFLD)
SELECT
SUBSTR(WHOLEFLD,4,1) AS SUBSTRFLD
(CASE
WHEN 'S' THEN 'S'
WHEN 'N' THEN 'N'
ELSE NULL
END)
FROM OLDTABLE;

*** Failure 3706 Syntax error: expected something between the word 'SUBSTRFLD' and '('.

I have tried many various thing. I am on V2R3.3.110.

Thanks.



     
  <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: 27 Dec 2016