sqlalchemy-teradata icon indicating copy to clipboard operation
sqlalchemy-teradata copied to clipboard

Using get_view_definition results in error

Open stmezzo opened this issue 6 years ago • 1 comments

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)

stmezzo avatar Nov 08 '18 05:11 stmezzo

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?

tserafim avatar Nov 09 '18 16:11 tserafim