Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 11 Nov 2002 @ 16:25:52 GMT


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


Subj:   Case syntax problem
 
From:   Hayes, Jim M

Hello,

I am exporting a file and the following snippet of code is generating an error message:

, (CASE
    WHEN AL1.Itin_Cmpmt_Cd = 'C'
      THEN  'P'
    WHEN  AL1.Itin_Cmpmt_Cd = 'F'
      THEN  'P'
      ELSE 'E'
  END AS "Cabin_Class")  (CHAR(1))

I have attempted to do this without the parens, with Cabin_Class both in and out of single, double and even double single quotes.

I have even checked Chapter 4 of the Teradata EDBMS Performance Optimization manual without success.

I am getting the following error:

*** Failure 3706 Syntax error: expected something between the word 'Cabin_Class' and ')'.
               Statement# 1, Info =718
    Input row number = 1 *** Total elapsed time was 0.00 seconds.

As a followup question, how do I refer to the alias in open code later in the process?

Is it Case < alias > or simply < alias >?


TIA

--Jim

Jim Hayes,
Delta Airlines, Network Analysis



     
  <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