Reputation: 2455
I'm trying to use the scrapy pipeline to store its data in a sqlite3 database here is the little part that trows a OperationalError: near "Transaction": syntax error
def createResidentialTable(self):
self.cur.execute("""CREATE TABLE IF NOT EXISTS Residential
(Id INT PRIMARY KEY NOT NULL, Transaction TEXT, Location TEXT, Price REAL)""")
My debugging so far, if i remove the Transaction TEXT & Location TEXT & Price Real from the creating tables my spider runs again. So i'm assuming there is something wrong with my listing of the tables.
Have looked trough some code examples and the official sqlite3 documentation and they list it as followed :
c.execute('''CREATE TABLE stocks
(date text, trans text, symbol text, qty real, price real)''')
Any thoughts or suggestions?
Upvotes: 0
Views: 214
Reputation: 190
Transaction
is a reserved keyword which you are not allowed to use as an identifier. Just use something other than Transaction
as an identifier.
Upvotes: 1