Teradata / sqlalchemy-teradata

A SQLAlchemy dialect for Teradata
https://developer.teradata.com/tools/articles/teradata-sqlalchemy-introduction
MIT License
59 stars 21 forks source link

Using get_view_definition results in error #78

Open stmezzo opened 6 years ago

stmezzo commented 6 years ago

When I call get_view_definition method using the following:

from sqlalchemy import create_engine from sqlalchemy.engine import reflection

td_engine = create_engine('teradata://user:pass@host/container?driver=Teradata') insp = reflection.Inspector.from_engine(td_engine) insp.get_view_definition("MyViewName")

I get the error: <class 'tuple'>: ('HY000', "[Teradata][ODBC Teradata Driver][Teradata Database] 'MyViewName' is not a table. ", 3853)

tserafim commented 6 years ago

I can reproduce. The query being executed is SHOW TABLE MyViewName, instead of SHOW VIEW MyViewName. Code is here

@stmezzo maybe you want to send a PR?