Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 01 Sep 2014 @ 12:23:53 GMT


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


Subj:   Re: Query which runs in SQLA but not working at BTEQ
 
From:   Dave Wellman

Hi,

I'm guessing that when using SQLA you are using an ODBC connection? If that is the case then it looks like the ODBC driver is converting some of the sql from 'odbc sql' to Teradata equivalent sql. This will not happen when using BTEQ.

You might want to try and re-write it using standard Teradata sql functions. The one that I think is causing problem is your is SUBSTRING.

The syntax shown in your query below is for the Teradata style SUBSTR function, SUBSTRING uses the following:

     SUBSTRING(column-name FROM nn FOR nn)

So, I think you need to change

     SUBSTRING(TRIM(NR.PM_AREA_TXT),7,1)

into

     SUBSTRING(TRIM(NR.PM_AREA_TXT)  FROM 7 FOR 1)

Also, you're missing an "(" character between "INSERT INTO DB.TGT_TAB" and "APP_NM ,", but that is probably a cut&paste error.


Cheers,

Dave

Ward Analytics Ltd - Information in motion (www.ward-analytics.com)



     
  <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