title: Invalid attribute in connection string: DBCNAME. when using create_engine & Pandas to_sql
body: <p>Afternoon,<br>
  Very new to python, but I'm stuck with the following error when trying to use <code>sqlalchemy</code> <code>create_engine</code> and <code>pandas</code> <code>to_sql</code> with Teradata. </p>
  
  <blockquote>
    <p><strong>Error message</strong>    DatabaseError: (teradata.api.DatabaseError) (0, '[08001] [TPT][ODBC SQL Server Wire Protocol driver]Invalid Connection
    Data., [TPT][ODBC SQL Server Wire Protocol driver]Invalid attribute in
    connection string: DBCNAME.')</p>
  </blockquote>
  
  <p><strong>Background</strong><br>
  I'm reading in some customer identifiers and connecting to a number of Teradata databases to extract some info and put it into pandas data frames,  as per sample in section one of the code below. This approach is repeated a number of times and works fine.  I now need to insert this data into another Teradata database. As such I would like to use sqlalchmey create_engine and pandas to_sql<br>
  I have installed "sqlalchemy-teradata" as well   </p>
  
  <p>The code throws the above error when the “df_name.to_sql… “ line is executed </p>
  
  <p>I have read the following, but can’t seem to find how to pass  DBCNAME into the connection string, or what’s causing the error  </p>
  
  <p><a href="https://stackoverflow.com/questions/31852582/i-am-trying-to-construct-an-sqlalchemy-engine-using-a-dict-which-has-variables-p">I am trying to construct an sqlalchemy engine using a dict which has variables parsed to it from tkinter</a>
  <a href="https://github.com/Teradata/sqlalchemy-teradata/wiki/Examples" rel="nofollow noreferrer">https://github.com/Teradata/sqlalchemy-teradata/wiki/Examples</a> 
  <a href="http://docs.sqlalchemy.org/en/latest/core/engines.html" rel="nofollow noreferrer">http://docs.sqlalchemy.org/en/latest/core/engines.html</a></p>
  
  <p>I have Teradata SQL assistant installed which uses the following connection info, below,  which I can login to with no problems </p>
  
  <pre><code>[ODBC]  
  DRIVER=Teradata  
  UID= abcdef  
  DBCNAME= aaaaa.bbb.ccccccc.co.uk  
  </code></pre>
  
  <p>I can also ping the DBCname from  the command prompt , which works fine </p>
  
  <p>Environment<br>
  3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] / windows 7 
  Teradata version  15.10.05.04 </p>
  
  <pre><code># section one 
  import pandas as pd
  import pyodbc
  # define my sql string here 
  xref_query = "SELECT A, B,C, "\
  "FROM someting "\
  "WHERE A= " +sql_param
  #connect to terdata ** this works fine**
  #Specify connection string
  conn = pyodbc.connect(r'DRIVER=
  {Teradata};DBCName=aaaaa.bbb.ccccccc.co.uk;DATABASE=somthing;
  Username=abcdef;password=ghijk')
  
  #connect and run sql 
  df_xref_temp = pd.read_sql(xref_query, conn)
  conn.close()
  
  #Section two
  from sqlalchemy import create_engine 
  #use sqlalchemy create_engine 
  #abcdef  = teradata user name 
  #ghijk = teradata password
  #@aaaaa.bbb.ccccccc.co.uk = teradata DBCname
  td_engine = create_engine(r'teradata://abcdef:ghijk@aaaaa.bbb.ccccccc.co.uk/databas_name')
  print(td_engine)
  #This results in 
  "Engine(teradata://abcdef:ghijk:***@daaaaa.bbb.ccccccc.co.uk/database_name)"   
  df_name.to_sql('fos_chtax_results',con=td_engine, if_exists='append', index 
  =False) 
  </code></pre>
  
  <p>Any help appreciated  </p>
  
  <p>Update 
  Morning,</p>
  
  <p>After a lot more reading I’ve manged to make some progress on this error </p>
  
  <p>It seems that if I use a Hostname connection instead of a DNS connection and specify a default driver it works 
  New code  </p>
  
  <pre><code>td_engine = create_engine("teradata://abcdef:ghijk@aaaaa.bbb.ccccccc.co.uk/database_name?driver=Teradata")  
  #new code using a variable 
  td_engine = create_engine(con_str)
  </code></pre>
  
  <p>I can also replace the text string with a variable as to make it dynamic . However I would like to use a dictionary method , as described below , but I can’t find a way to include the extra data information for the Hostname approach i.e. “?driver=Teradata”. The documentation would seem to suggest its not supported ? 
  <a href="https://stackoverflow.com/questions/31852582/i-am-trying-to-construct-an-sqlalchemy-engine-using-a-dict-which-has-variables-p">I am trying to construct an sqlalchemy engine using a dict which has variables parsed to it from tkinter</a></p>