Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 11 Jan 2005 @ 13:57:59 GMT


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


Subj:   Discrepancies between ITEQ and BTEQ
 
From:   Vivek.SinghKushwah

Hi,

I have noticed some discrepancies between ITEQ and BTEQ(Demo Version).

Following code which is working fine in ITEQ, does not work in BTEQ (Demo Version) and QueryMan.

i.e.

     SELECT
     CASE
        WHEN INDEX(TRIM(AnyCol), ' ') GT 1 THEN 0
        ELSE
        CASE
           WHEN
                  SUBSTR(AnyCol,1,1) IN
     ('','0','1','2','3','4','5','6','7','8','9')
              AND SUBSTR(AnyCol,2,1) IN
     ('','0','1','2','3','4','5','6','7','8','9')
              AND SUBSTR(AnyCol,3,1) IN
     ('','0','1','2','3','4','5','6','7','8','9')
              AND SUBSTR(AnyCol,4,1) IN
     ('','0','1','2','3','4','5','6','7','8','9')
           THEN CAST(AnyCol AS INTEGER)
           ELSE 0
        END
     END
     FROM AnyTable;

But the same above code is throwing the following error in BTEQ(Demo Version) and QueryMan.

       CASE
           $
      *** Failure 3706 Syntax error: expected something between the 'ELSE'
     keyword and the 'CASE' keyword.
                     Statement# 1, Info =188
      *** Total elapsed time was 1 second.

Following code which is working fine in BTEQ(Demo Version) and QueryMan, does not work in ITEQ with error "2620 The format or data contains a bad character".

     SELECT CAST('1 234' AS INTEGER);

I will appreciate if somebody could explain it.


Thanks

Vivek



     
  <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