title: pandasql for pandas dataframe throwing error
body: <p>My Pandas Dataframe named as data_five_minutes:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th></th>
  <th>script_id</th>
  <th>date_time</th>
  <th>open</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>0</td>
  <td>1</td>
  <td>2019-01-11 09:35:00</td>
  <td>25</td>
  </tr>
  <tr>
  <td>1</td>
  <td>1</td>
  <td>2019-01-11 09:40:00</td>
  <td>30</td>
  </tr>
  <tr>
  <td>2</td>
  <td>1</td>
  <td>2019-01-11 09:45:00</td>
  <td>48</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Full ss:</p>
  <p><a href="https://i.stack.imgur.com/hiI6E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hiI6E.png" alt="enter image description here" /></a></p>
  <p>Now I was trying to get only data which are having script_id as 1:</p>
  <pre><code>    data = ps.sqldf(f&quot;&quot;&quot;SELECT d4.script_id,d4.date_time,d4.open,d4.high,d4.low,d4.close,d4.volume
                            FROM data_five_minutes d4 WHERE d4.script_id = {id}&quot;&quot;&quot;)
  </code></pre>
  <p>this is just small condition but in original it has nested where clause so SQL query will be passed on original code as earlier i was passing the same query in database.</p>
  <p>I am getting below error:</p>
  <blockquote>
  <p>Traceback (most recent call last):   File
  &quot;C:\Python\lib\site-packages\sqlalchemy\engine\base.py&quot;, line 1752, in
  _e xecute_context
  cursor, statement, parameters, context   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\default.py&quot;, line 714,
  in do_executemany
  cursor.executemany(statement, parameters) sqlite3.InterfaceError: Error binding parameter 2 - probably unsupported type.</p>
  <p>The above exception was the direct cause of the following exception:</p>
  <p>Traceback (most recent call last):   File
  &quot;D:\python_projects\auto\testing.py&quot;, line 70, in 
  FROM data_five_minutes d4 WHERE d4.script_id = 1&quot;&quot;&quot;)   File &quot;C:\Python\lib\site-packages\pandasql\sqldf.py&quot;, line 156, in sqldf
  return PandaSQL(db_uri)(query, env)   File &quot;C:\Python\lib\site-packages\pandasql\sqldf.py&quot;, line 58, in <strong>call</strong>
  write_table(env[table_name], table_name, conn)   File &quot;C:\Python\lib\site-packages\pandasql\sqldf.py&quot;, line 121, in
  write_table</p>
  <pre><code>index=not any(name is None for name in df.index.names))  # load index into d b if all levels are named   File
  </code></pre>
  <p>&quot;C:\Python\lib\site-packages\pandas\io\sql.py&quot;, line 518, in to_sql
  method=method,   File &quot;C:\Python\lib\site-packages\pandas\io\sql.py&quot;, line 1320, in to_sql
  table.insert(chunksize, method=method)   File &quot;C:\Python\lib\site-packages\pandas\io\sql.py&quot;, line 756, in insert
  exec_insert(conn, keys, chunk_iter)   File &quot;C:\Python\lib\site-packages\pandas\io\sql.py&quot;, line 670, in
  _execute_ins ert
  conn.execute(self.table.insert(), data)   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\base.py&quot;, line 1263, in
  ex ecute
  return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)   File &quot;C:\Python\lib\site-packages\sqlalchemy\sql\elements.py&quot;, line
  324, in _e xecute_on_connection
  self, multiparams, params, execution_options   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\base.py&quot;, line 1462, in
  _e xecute_clauseelement
  cache_hit=cache_hit,   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\base.py&quot;, line 1815, in
  <em>e xecute_context
  e, statement, parameters, cursor, context   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\base.py&quot;, line 1996, in
  <em>h andle_dbapi_exception
  sqlalchemy_exception, with_traceback=exc_info[2], from</em>=e   File &quot;C:\Python\lib\site-packages\sqlalchemy\util\compat.py&quot;, line 207, in
  rai se</em>
  raise exception   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\base.py&quot;, line 1752, in
  _e xecute_context
  cursor, statement, parameters, context   File &quot;C:\Python\lib\site-packages\sqlalchemy\engine\default.py&quot;, line 714,
  in do_executemany
  cursor.executemany(statement, parameters) sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding
  parameter 2 - probably unsupported type. [SQL: INSERT INTO
  data_five_minutes (script_id, date_time, open, high, low, clos e,
  volume) VALUES (?, ?, ?, ?, ?, ?, ?)] [parameters: ((1, '2021-05-25
  10:30:00.000000', Decimal('1978.6'), Decimal('1985 '),
  Decimal('1978.1'), Decimal('1985'), Decimal('323')), (1, '2021-05-25
  10:35:0
  0.000000', Decimal('1985'), Decimal('1986.05'), Decimal('1982.75'), Decimal('198
  3.85'), Decimal('954')), and so on...] (Background on this error at: <a href="https://sqlalche.me/e/14/rvf5" rel="nofollow noreferrer">https://sqlalche.me/e/14/rvf5</a>)</p>
  <p>Process returned 1 (0x1)        execution time : 2.672 s Press any key
  to continue . . .</p>
  </blockquote>