Teradata/PyTd

ODBC 16.20 -- Syntax error

padhia opened this issue · 4 comments

Not sure if I am missing something, but following code fails to run when using 16.20 ODBC driver.

import teradata

with teradata.tdodbc.connect(host='localhost', system='dbc', username='xxxx', password='xxxx') as conn, conn.cursor() as csr:
    csr.execute("select * from dbc.tablesv where TableName Like '%+_TD15' ESCAPE '+'")
    print([list(row) for row in csr.fetchall()])

The error I get back is:

teradata.api.DatabaseError: (3706, "[42000] [Teradata][ODBC Teradata Driver][Teradata Database](-3706)Syntax error: expected something between the word 'TODO' and ':'.")

BTEQ is able to run the above SQL correctly.

This is my test environment:
Teradata Database: 16.10
Python teradata module: 15.10.0.21
Teradata ODBC: 16.20.00.00 (SIMBA Teradata ODBC driver package for Ubuntu)
OS: Ubuntu 17.10 64 bit

did this run using a prior teradata odbc driver?

It did with 15.10.

This looks like a potential bug with the 16.20 ODBC driver. I've reported it to the ODBC support team.

ODBC driver 16.20.00.18 fixed this issue.