I am trying to insert string into BLOB column using sqlite3 in Python. I saw some examples using binary file but I am trying to do it without files. Here is my code-
import sqlite3
c = sqlite3.connect(path_to_db)
# my string
ablob = 'Hello world!'
sql_statement = 'INSERT into table VALUES (?)'
c.execute(sql_statement, [sqlite3.Binary(ablob)])
c.commit()
c.close()
After execution, new column with the string is added but not in a blob column. Does anyone know what is the problem?