Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

ODBC 16.20 -- Syntax error #90

Closed padhia closed 6 years ago

padhia commented 6 years ago

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

DaveRoth commented 6 years ago

did this run using a prior teradata odbc driver?

padhia commented 6 years ago

It did with 15.10.

escheie commented 6 years ago

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

padhia commented 6 years ago

ODBC driver 16.20.00.18 fixed this issue.