I am uploading a .zip file to AWS Lambda which contains a .py file. After uploading I am getting an error like this:
attempt to write a readonly database
[ERROR] OperationalError: table "AuData1" already exists
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 15, in lambda_handler
cur.execute('''END RequestId: f5539447-a6d8-47ed-b415-5e2971923357
The code for .py file is:
def lambda_handler(event,context):
try:
conn = sqlite3.connect('SearchResultData.db')
cur = conn.cursor()
cur.execute('DROP TABLE IF EXISTS AuData1')
except Exception as e:
print(e)
cur.execute('''
CREATE TABLE "AuData1" (
.......
So basically the sqlite database present in the folder contains this table 'AuData1' but I want it to drop that and create a new one. However the database is not accessible as it says "readonly database". Please help if any solution available. Thank you in advance