Connecting Python with Teradata using Teradata module

后端 未结 3 1516
温柔的废话
温柔的废话 2020-12-07 15:10

I have installed python 2.7.0 and Teradata module on Windows 7. I am not able to connect and query TD from python.

pip install Teradata

Now I wa

3条回答
  •  自闭症患者
    2020-12-07 15:25

    To add on to Prayson's answer, you can use the teradatasql package (found on pypi). This package doesn't require you to install Teradata drivers (other than this package). Use it like so:

    import teradatasql
    import pandas as pd
    
    with teradatasql.connect(host='host', user='username', password='password') as connect:
        data = pd.read_sql('select top 5 * from table_name;', connect)
    
    

提交回复
热议问题