Linked Questions
22 questions linked to/from SQLite parameter substitution problem
0
votes
1
answer
822
views
Check if a username is in a database using python and sqlite3 [duplicate]
I'm trying to check if a username is in a database using python and SQLite3, here's my code
name = request.form.get("username")
namecheck = db.execute("SELECT * FROM users WHERE ...
0
votes
1
answer
896
views
Deleting a row from a mariaDB database using python [duplicate]
I am at a complete loss at this point. I have tried many ways to get this to work but I am still having trouble. I am building a simple script to add or delete movies to a mariaDB database. The adding ...
0
votes
1
answer
185
views
SQLITE3 + execute Insert [duplicate]
Trying to execute insert an item coming from a list:`
item=u'Sunil Goyal'
c.execute('''INSERT INTO bpersons(person_name) VALUES (?)''',item)`
is simple enough, but ...
-1
votes
2
answers
145
views
What am I doing wrong in my query? [duplicate]
So I have a table in my Customers.db file that looks like this:
I wanted to make a function which returns the "rows" which has the id equal to the user input. The Table is also called 'Customers and ...
0
votes
0
answers
122
views
Passing parameters in SQLite in Python/Flask [duplicate]
I have a very dumb issue which I've been absolutely breaking my head over for a while now
##########CODE 1 (STATIC)##############
@app.route('/fromdb', methods=['GET'])
def printall():
data = g.db....
-1
votes
1
answer
74
views
Insert into SQLITE Using single variable [duplicate]
What is the correct way to insert data into a single column in a table using a python variable?
I have tried
crsr.execute("INSERT INTO PBI(Acceptance_Criteria) VALUES (?)",wi_criteria)
...
1
vote
0
answers
58
views
Search SQLite data from user input [duplicate]
import sqlite3
conn = sqlite3.connect('ProcessPower.db')
c = conn.cursor()
user_input = (input("Enter a Type: "))
c.execute("SELECT * FROM Instrumentation WHERE Type = ?", user_input)
rows = c....
0
votes
1
answer
57
views
incorret number of bindings Python SQlite [duplicate]
I have a list and I am using a for loop to add each item as a column on the same row of this table. The list has about 60 items. I am adding each one word at a time but it's trying to count each ...
0
votes
0
answers
41
views
Python sqlite can't seem to count bind parameters? [duplicate]
I've got a little module doing some sqlite operations,
and python/sqlite can't seem to count the number of arguments
it's passing (thinks there's 7 parameters instead of 1)?
sql = 'select * ...
0
votes
0
answers
44
views
How to I convert a sqlite command to a python-sqlite command [duplicate]
How would I implement the following command in python:
ALTER TABLE {tableName} ADD COLUMN COLNew {type};
Taken from this post
I assume it would look something like the following:
cursor.execute('...
0
votes
0
answers
29
views
Python and SQLite - how to "escape" string on SELECT and INSERT? [duplicate]
I'm trying to search for and (if not found) insert passwords in one of the tables that I have set up, but if the password ends with a single quote or .. there were a couple of other symbols, too .. it ...
0
votes
1
answer
6k
views
Python 3 SQLite3 - Incorrect number of bindings
I understand there are MANY questions on Stack Overflow about this error but I have tried MANY solutions and obviously they have all failed.
Here's a list:
sqlite3.ProgrammingError: Incorrect number ...
6
votes
3
answers
1k
views
SQLite: Why can't parameters be used to set an identifier?
I'm refactoring a little side project to use SQLite instead of a python data structure so that I can learn SQLite. The data structure I've been using is a list of dicts, where each dict's keys ...
1
vote
2
answers
552
views
Dynamically output CSV files
I have created a SQLite database utilizing the 'Spyder' Python IDE. The database contains a table called "Engine_Data."
Each week, I have to parse the data in "Engine_Data" by the variable "Engine ...
0
votes
2
answers
685
views
Python SQLite3: Cannot Create Table with Variable in Query
I have the following code to create a table if it does not already exist in a database.
TABLE_NAME = 'Test'
sql = sqlite3.connect('DATABASE.db')
cur = sql.cursor()
cur.execute('CREATE TABLE IF NOT ...