0
cur.execute(
    "INSERT INTO  tool1 ( USERID , USER_NAME , GROUP_NAME) VALUES (108535, ? , ? )",
     ( userName, groupName ) );

tool1 needs to be variable

Melon
  • 874
  • 8
  • 17
user3214392
  • 245
  • 4
  • 15
  • 2
    Why do you not want to use string concatenation? – Daniel Jan 20 '14 at 09:12
  • `cur.execute("INSERT INTO %s (USERID , USER_NAME , GROUP_NAME) VALUES (108535, ? , ?)" % table_name, (userName, groupName))` or `cur.execute("INSERT INTO {} (USERID , USER_NAME , GROUP_NAME) VALUES (108535, ? , ?)".format(table_name), (userName, groupName))` ? – falsetru Jan 20 '14 at 09:32

0 Answers0