Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 01 Sep 2014 @ 11:20:32 GMT


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


Subj:   Query which runs in SQLA but not working at BTEQ
 
From:   Jepamony, Johnpaul

Hello Experts,

Could one some help me to debug this below issue.

     INSERT INTO DB.TGT_TAB
     APP_NM ,
     CLNT_VAL ,
     CLAIM_NO ,
     SEQ ,
     PM_AREA_TXT
     )
     SELECT
     NR.APP_NM
     ,(SELECT CLNT_VAL FROM DB.CLNT WHERE A_CLNT_ID =NR.CLIENT_CD) AS CLNT_VAL ,NR.CLAIM_NO
     ,NR.SEQ ,(CASE WHEN( LENGTH(NR.PM_AREA_TXT) = 13 AND
     SUBSTRING(TRIM(NR.PM_AREA_TXT),7,1) <> '' )THEN
     SUBSTRING(TRIM(NR.PM_AREA_TXT),7,1)
     WHEN (LENGTH(NR.PM_AREA_TXT) > 13 AND SUBSTRING(TRIM(NR.PM_AREA_TXT),8,1) <> '' )THEN
     SUBSTRING(TRIM(NR.PM_AREA_TXT),8,1)
     ELSE 'UNK' END )AS PM_AREA_TXT
     FROM DB.SRC_TAB NR;

We are using Teradata version 14.10. I can run and load this target table in SQLA but if I execute them in BTEQ, it throws me below error

     *** Failure 3706 Syntax error: expected something between ')' and ','.
     Statement# 1, Info =308
     *** Total elapsed time was 3 seconds.

What could be the problem? ?Any help would be greatly appreciated!!


Regards,

John



     
  <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