Note the added comma after “temp” below:
cur.execute('insert into new_test (curent_dt) values (?)', (temp,))
The reason this happens is that (temp)
is an integer but (temp,)
is a tuple of length one containing temp
.
More Related Contents:
- How to read datetime back from sqlite as a datetime instead of string in Python?
- Parameter unsupported when inserting int
- How to convert local time string to UTC?
- Filtering Pandas DataFrames on dates
- Variable table name in sqlite
- How to print pandas DataFrame without index
- Converting string with UTC offset to a datetime object [duplicate]
- How do I convert a datetime to date?
- Convert string date to timestamp in Python
- Getting today’s date in YYYY-MM-DD in Python?
- type object ‘datetime.datetime’ has no attribute ‘datetime’
- Python insert numpy array into sqlite3 database
- Splitting timestamp column into separate date and time columns
- Extract day of year and Julian day from a string date
- Get year, month or day from numpy datetime64
- Convert string “Jun 1 2005 1:33PM” into datetime
- Python time to age, part 2: timezones [duplicate]
- Python pandas convert datetime to timestamp effectively through dt accessor
- Which is the fastest way to extract day, month and year from a given date?
- Get time zone information of the system in Python?
- Locate first and last non NaN values in a Pandas DataFrame
- Format of datetime in pyplot axis
- How to convert Python’s .isoformat() string back into datetime object [duplicate]
- SQLite, python, unicode, and non-utf data
- Pycharm environment different than command line
- Python summing up time
- Ceil a datetime to next quarter of an hour
- Clean way to convert quarterly periods to datetime in pandas
- Python: Matplotlib avoid plotting gaps
- Python Pandas : pandas.to_datetime() is switching day & month when day is less than 13