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

tool1 needs to be variable

2
  • 2
    Why do you not want to use string concatenation? Commented Jan 20, 2014 at 9: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)) ? Commented Jan 20, 2014 at 9:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.