conn_img and td_engine are not the same. conn_img is using pyodbc to connect to the database using odbc, however creating an engine with teradata dialect creates a connection to the database using using another dbapi driver called tdodbc.
The engine you use in the to_sql method is a connection to the sqlite database, not teradata. Is that what you are trying to do? What database is in your DSN (LMG-LDAP) when you connect with pyodbc?
How is conn_bmg defined? It may have to do with the odbc driver you are using, make sure you are using the teradata-odbc driver.
I installed anaconda and using jypter as shell.
I came to know that once we install anaconda automatically all packages will get installed .
Are you familiar with the python and jupyter environment? Are you using virtual enviornments?
You can check what packages you have installed with `conda list`. Can you ensure that it has sqlalchemy-teradata?
I am new to this eniv.. Learning..
Did some data prasing in python and want to send back that data into teradata tables.
Yes i did i am able to see sqlalchemy V 1.2..11
And I cant see 'sqlalchemy - teradata'
here my connections:
td_userID = getpass.getpass('Enter User id')
td_password = getpass.getpass('Enter pwd')
conn_lmg = pyodbc.connect('DSN=xxxx;UID='+str(td_userID)+';PWD='+str(td_password))
del td_password, td_userID
conn_lmg.autocommit = True
curs = conn_lmg.cursor()
getting this issue while iam installing
pip install sqlalchemy-teradata
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1045)'))': /simple/sqlalchemy-teradata/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1045)'))) - skipping
I requested my admin to install that packages in my local machine.
Mean while i am exporting dataframe data into csv and and insertting that data into table in python.. i am getting this error. Please can you help me in this..
df1.to_csvpath ,index=False) -- data imported to csv
with open(path)as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
curs.execute(""""INSERT INTO PYTHON_LKP(STMT_DESC,tran_amt, tran_cnt )VALUES(?,?,?)""",(row))
error message :
ProgrammingError: ('42000', ' [Teradata][ODBC Teradata Driver][Teradata Database] String not terminated before end of text. (-3760) (SQLPrepare)')