So I’m trying to learn how to manage databases for a fun project, basically how cursed I am when rolling dice in DnD. I’ve created a table within Libre office base with rolls from a few sessions and I think I’ve connected successfully to the database but can’t seen to access the table.
however when I try to load i get the following:
c:/Users/Raymond/python/curseliftersrolls.py
Traceback (most recent call last):
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 1819, in _execute_context
self.dialect.do_execute(
File “C:\Python310\lib\site-packages\sqlalchemy\engine\default.py”, line 732, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: near “DnDRolls”: syntax error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “c:\Users\Raymond\python\curseliftersrolls.py”, line 11, in
rolls_by_people = pd.read_sql(“DnDRolls”, engine)
File “C:\Python310\lib\site-packages\pandas\io\sql.py”, line 592, in read_sql
return pandas_sql.read_query(
File “C:\Python310\lib\site-packages\pandas\io\sql.py”, line 1557, in read_query
result = self.execute(*args)
File “C:\Python310\lib\site-packages\pandas\io\sql.py”, line 1402, in execute
return self.connectable.execution_options().execute(*args, **kwargs)
File “”, line 2, in execute
File “C:\Python310\lib\site-packages\sqlalchemy\util\deprecations.py”, line 401, in warned
return fn(*args, **kwargs)
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 3176, in execute
return connection.execute(statement, *multiparams, **params)
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 1291, in execute
return self._exec_driver_sql(
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 1595, in _exec_driver_sql
ret = self._execute_context(
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 1862, in _execute_context
self.handle_dbapi_exception(
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 2043, in handle_dbapi_exception
util.raise(
File “C:\Python310\lib\site-packages\sqlalchemy\util\compat.py”, line 208, in raise
raise exception
File “C:\Python310\lib\site-packages\sqlalchemy\engine\base.py”, line 1819, in _execute_context
self.dialect.do_execute(
File “C:\Python310\lib\site-packages\sqlalchemy\engine\default.py”, line 732, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near “DnDRolls”: syntax error
[SQL: DnDRolls]
(Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation)
all of that stems from these few lines in a python IDE
#connect with database
engine = create_engine(‘sqlite:///C:\Users\Raymond\Documents\New Database.odb’)
#load from table
rolls_by_people = pd.read_sql(“DnDRolls”, engine) <— this is where it errors
Any Help would be appreciated.