Created
December 20, 2013 11:17
-
-
Save atsuya046/8053450 to your computer and use it in GitHub Desktop.
sqliteのクエリを組み立てるとき、配列の長さの分だけ"?"を作る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for row in csv.reader(data): | |
params = ', '.join(map(lambda s: '?', row)) | |
c.execute('''insert into %s values (%s) ''' % (table_name, params), row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment