Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 22 Oct 2001 @ 20:18:06 GMT


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


Subj:   Re: SQL question (see red line below)
 
From:   David Hough

Tony:

Adding the (INTEGER) between END and AS FLAG works for me on V2R4.0.2, but I seem to remember problems like this on older versions. Try enclosing your CASE statement in parentheses, and then applying the cast like this:

  SELECT
 (CASE WHEN SUBSTR(DX1,1,3) IN('290','V11','V40')   THEN 1
.
.
.
      WHEN DX1 IN('07953','79571','V6544')         THEN 4
      ELSE 0
 END)  (INTEGER)               AS FLAG
FROM DB2WHSP.V_RALS_IP_CLAIM

The extra parens are sometimes needed around the first argument of a CAST() operation, too.

Does that help?

/dave hough



     
  <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