Boa tarde,
@thanael
Usando o pandas deu os seguintes erros.
C:/Python310/python.exe c:/Projetos/api/getClienteV2.py
C:\Python310\lib\site-packages\pandas\io\sql.py:761: UserWarning: pandas only support SQLAlchemy connectable(engine/connection) ordatabase string URI or sqlite3 DBAPI2 connectionother DBAPI2 objects are not tested, please consider using SQLAlchemy
warnings.warn(
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 2020, in execute
cur.execute(*args, **kwargs)
pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'sqlite_master'. (208) (SQLExecDirectW); [42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. (8180)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Projetos\api\getClienteV2.py", line 26, in <module>
df.to_sql('cliente',conexao,index=False,if_exists='append')
File "C:\Python310\lib\site-packages\pandas\core\generic.py", line 2951, in to_sql
return sql.to_sql(
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 697, in to_sql
return pandas_sql.to_sql(
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 2189, in to_sql
table.create()
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 831, in create
if self.exists():
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 815, in exists
return self.pd_sql.has_table(self.name, self.schema)
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 2197, in has_table
return len(self.execute(query, [name]).fetchall()) > 0
File "C:\Python310\lib\site-packages\pandas\io\sql.py", line 2032, in execute
raise ex from exc
pandas.io.sql.DatabaseError: Execution failed on sql 'SELECT name FROM sqlite_master WHERE type='table' AND name=?;': ('42S02', "[42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'sqlite_master'. (208) (SQLExecDirectW); [42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. (8180)")