placeholder for varchar sql

0

I'm doing a program that reads the Arduino output and sends it to a SQLITE3 database.

You're giving me this error:

cursor.execute("INSERT INTO reciclagem_data (personID, nome) VALUES (%s,%s)", (pieces[0], pieces[1]))
OperationalError: near "%": syntax error

personID is the UID of an RFID card and the name is simply the name.
I searched and found that the best date type for the UID would be varchar. I think that error has something to do with it.

What should I do to solve this problem?

    
asked by anonymous 12.07.2018 / 03:13

1 answer

0

In Sql, information is separated by a semicolon. ;

INSERT INTO reciclagem_data (personID, nome) VALUES (%s,%s)
('Valor1','valor3')
('Valor2','valor3')
('Valor3','valor3')

Please check your shipping if by one of his words was not like this:

 ('Va'lor4','val'or4'),

No Sql will not!

    
12.07.2018 / 06:34