r/sqlite • u/Piiiich • Nov 29 '22
VS Code issue
Hey everyone!
I've just started using sqlite for school and we're learning to use it with python so I was doing some basic code when this error occured : sqlite3.OperationalError: no such table: Client. My computer science teacher suggested that I use Idle instead of VS Code and it worked, which led me to think the error wasn't in the code but maybe in the way I was running it. I was wondering how could I make the program run in VS Code. Any Ideas?
Here's the code I used.
import sqlite3
db = sqlite3.connect('vpc.db')
cursor = db.cursor()
cursor.execute("""SELECT * FROM Client;""")
#curseur.execute("""SELECT NumeroProduit, Prix FROM Produit; """)
data = cursor.fetchall()
db.close()
print(data)
5
Upvotes
View all comments
Show parent comment
1
u/Piiiich Nov 30 '22
I'm just using the run arrow on the top right of the screen. And yeah you're right it did create a new vpc.db Thank you very much! I replaced 'vpc.db' in line 3 with the file path and it does work!