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:
- parameter unsupported when inserting int in sqlite
- How to read datetime back from sqlite as a datetime instead of string in Python?
- Converting between datetime, Timestamp and datetime64
- Iterating through a range of dates in Python
- Parsing date with timezone from an email?
- Can’t subtract offset-naive and offset-aware datetimes
- Convert datetime to Unix timestamp and convert it back in python
- Find the closest date to a given date
- How to increment a datetime by one day?
- OperationalError: database is locked
- Sqlite3, OperationalError: unable to open database file
- How to get current time in python and break up into year, month, day, hour, minute?
- Fetching datetime from float in Python
- “import datetime” v.s. “from datetime import datetime”
- How do you convert a datetime/timestamp from one timezone to another timezone?
- Why does datetime.datetime.utcnow() not contain timezone information?
- Bulk insert huge data into SQLite using Python
- Convert a column of datetimes to epoch in Python
- pd.Timestamp versus np.datetime64: are they interchangeable for selected uses?
- “no such table” exception
- How to convert epoch time with nanoseconds to human-readable?
- Python pandas integer YYYYMMDD to datetime
- What is an efficient way of inserting thousands of records into an SQLite table using Django?
- Formatting “yesterday’s” date in python
- Convert JSON to SQLite in Python – How to map json keys to database columns properly?
- Python: Datetime to season
- finding last business day of a month in python
- Python strptime parsing year without century: assume prior to this year?
- Pandas datetimes with different formats in the same column
- Get weekday/day-of-week for Datetime column of DataFrame