Query not working ODBC driver 15.10

Connectivity
Fan

Query not working ODBC driver 15.10

The following query works using the ODBC 15.00 drivers but not using the new 15.10 ODBC drivers. The error  "Select failed 3706  Syntax error: expected something between '(' and the 'trim' keyword"

I am not a Teradata developer I am jsut helpign an enduser try and reslove the issue. 

select a.month_key,

a.ossc_rc,

a.mecontext,

a.ossc_rc as osscrc,

b.subnetwork2,

a.mecontext as mecontext1,

a.eutrancellfdd as eutrancellfdd1,

a.mecontext AS EnodeB,

a.enodebtype,

'Ericsson' AS OEM,

c.region,

c.marketname,

c.cascadeid,

c.sector,

c.carrier,

C.enodebid,

b.band,

b.cellid,

a.mecontext as mecontext2,

a.eutrancellfdd as eutrancellfdd2,

a.kpi_connection_drop_rate_n,

a.kpi_connection_drop_rate_d

from 

F74_LTE_ERICSSON_VIEW.VFLE801_FDDCELL_MONTHLY_AGRT a

inner join F74_LTE_ERICSSON_VIEW.vDLE001_FDDCELL b 

on  a.fddcell_key = b.fddcell_key

inner join F74_LTE_ERICSSON_VIEW.VDLE051_ORGANIZATIONALDATA c 

on  b.mecontext = c.mecontext 

and b.sector= c.sector

and b.carrier = c.carrier

where a.Month_key >= concat(trim(year(current_date-365)),trim(case when td_month_of_year(current_date-365) > 9 then  trim(td_month_of_year(current_date-365))  else '0'|| trim(td_month_of_year(current_date-365) ) end))

Tags (1)
3 REPLIES
Senior Apprentice

Re: Query not working ODBC driver 15.10

There's no YEAR or CONCAT in Teradata SQL, those are ODBC functions.

The new version of ODBC doesn't support them anymore by default, you must either use an ODBC Escape Sequence {fn YEAR(...)} or check "Enable Legacy Parser" in the ODBC driver options.

But you don't need it, these should return the same result:

WHERE a.Month_key >= TRIM(CURRENT_DATE-365 (format 'yyyymm'))

or

WHERE a.Month_key >= TO_CHAR(CURRENT_DATE-365, 'yyyymm')

Fan

Re: Query not working ODBC driver 15.10

Thanks Dieter I will have them try it today and let everyone know. Thanks again for the quick resposne.

Fan

Re: Query not working ODBC driver 15.10

Just wanteed to report back the query chage did work. Really appericate the help.   Just one other question is there a link I can direct users to as to what has been changed in drivers for the 15.10 release?