I want to modify the code beneath so that I only insert input variable to the table. All other columns should store NULL value. I think the most obvious solution would be to declare that column2 = NULL and column3 = NULL, but I was thinking is there another way?
import sqlite3
column1 = input()
sqliteConnection = sqlite3.connect('database.db')
cursor = sqliteConnection.cursor()
sqlite_insert_with_param = "INSERT INTO ideas (column1, column2, column3) VALUES (?, ?, ?);" #column1 is primary key
data_tuple = (column1, column2, column3)
cursor.execute(sqlite_insert_with_param, data_tuple)
sqliteConnection.commit()
cursor.close()
Eventually I want this to work in Tkinter app that prompts user input for column 1 with Entry-widget and it would create the database entry without any other information on it other than the primary key.