Is there a way to use variable length placeholders in an SQL query?
Right now with a 3-tuple, I write something like this:
c.execute('SELECT * FROM table WHERE word IN (?, ?, ?)', tup)
But what if the tup can be of differing lengths, perhaps a 4-tuple or 2-tuple? Is there a syntax for using placeholders in this situation? If not, what is the preferred way to write the code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…