title: select rows from teradata database using python based on another column in df
body: <p>I am trying to limit my query to a table in teradata database using python</p>
  <pre><code>#1.params=dfm['cust'].astype(str).to_list()
  params=tuple(list(dfm['cust'].astype(str)))
  import teradata
  import pandas as pd
  
  
  #Make a connection
  udaExec = teradata.UdaExec (appName=&quot;test&quot;, version=&quot;1.0&quot;, logConsole=False)
  
  
  with udaExec.connect(method=&quot;ODBC&quot;,system=host, username=uid,
                               password=pwd, driver=&quot;Teradata Database ODBC Driver 16.20&quot;,authentication=&quot;LDAP&quot;) as connect:
  
      
      query = &quot;SELECT Cust, Flag FROM DBName.Tablename where Cust in %(params)s&quot;
  
      #Reading query to df
      df = pd.read_sql(query,connect,params=params)
  
  </code></pre>
  <p>I tried to supply params as a list and it did not work. I tried to supply params as a tuple and it still did not work. I got the following error.</p>
  <pre><code>Execution failed on sql 'SELECT Cust,Flag FROM DBName.TableName where Cust in %(params)s': (3704, &quot;[42000] [Teradata][ODBC Teradata Driver][Teradata Database](-3704)'%' ('25'X) is not a valid Teradata SQL token.&quot;)
  </code></pre>
  <p>What is wrong with the code?</p>