title: database error in sqlite using python
body: <p>I am getting an error in sqlite db. The script works fine in windows but not in linux.</p>
  
  <p>I am trying to get the table names from two databases(there will be only one table in each table) and make select queries on those tables.</p>
  
  <p>Code -</p>
  
  <pre><code>db1 = r"C:\Users\X\Documents\sqlitedb\8007.db"
  db2 = r"C:\Users\X\Documents\sqlitedb\8008.db"
  
  conn = sqlite3.connect(db1)
  conn2 = sqlite3.connect(db2)
  conn.execute("ATTACH '{}' AS db2".format(db2))
  
  res = conn.execute("SELECT name FROM sqlite_master WHERE type='table';")
  for name in res:
      tblname1 = name[0]
      #print(tblname1)
  
  res2 = conn2.execute("SELECT name FROM sqlite_master WHERE type='table';")
  for name in res2:
      tblname2 = name[0]
      #print(tblname2)
  
  res1 = conn.execute("""SELECT * FROM main."""+tblname1+"""
                     WHERE IDKey NOT IN
                       (SELECT IDKey FROM db2."""+tblname2+""")
                  """).fetchall()
  res2 = conn.execute("""SELECT * FROM db2."""+tblname2+"""
                     WHERE IDKey NOT IN
                       (SELECT IDKey FROM main."""+tblname1+""")
                  """).fetchall()
  </code></pre>
  
  <p>The error is -</p>
  
  <p><code>select_mismatched_files
       """).fetchall()
  sqlite3.OperationalError: near "SELECT": syntax error</code></p>
  
  <p>The error is in this line --</p>
  
  <pre><code>res2 = conn.execute("""SELECT * FROM db2."""+tblname2+"""
                     WHERE IDKey NOT IN
                       (SELECT IDKey FROM main."""+tblname1+""")
                  """).fetchall()
  </code></pre>
  
  <p>Any help is highly appreciated.</p>