-1

I am getting the mentioned error in the Atom code editor. It is very strange because the same code works perfectly in Sublime Text, but in Atom it says that the column does not exist. I have searched for information but only found this similar question but they don't give answer, do I have to configure something in the editor? Here is the code that gives me the error:

import sqlite3
BDConnect = sqlite3.connect("XLDB.db")
Cur = BDConnect.cursor()
BDConnect.close

data = Cur.execute("SELECT NOMBRE,FECHA,TIPOLOSA FROM CALCULOS")

Throws me: sqlite3.OperationalError: no such table: CALCULOS.

I am using Script package.

Jalkhov
  • 167
  • 5
  • 18

2 Answers2

1

Solved, I have to put the full path to the database not the relative path. It is very strange that for Atom it has to be like that, but ok.

BDConnect = sqlite3.connect("absolute\path\to\XLDB.db")
Jalkhov
  • 167
  • 5
  • 18
-1

The error says it all: There is no table CALCULOS in XLDB.db. The logical step would be to add that table to the database

query = """
CREATE TABLE IF NOT EXISTS CALCULOS (
...
);
cursor.execute(query)
connection.commit()
Jacob Lee
  • 4,405
  • 2
  • 16
  • 37
  • But the table already exists, the `XLDB.db` file already contains a table called `CALCULOS`, in sublime text the query runs correctly and returns the data. – Jalkhov Mar 03 '21 at 02:07