title: sqlite - attach database
body: <p>I followed some of the information I found on web about attaching a sqlite database for the purpose of copying a table from one sqlite db to another but I can't seem to get it working. I try to attach the database with this code:</p>
  
  <pre><code>DB_PATH = context.getDatabasePath("WineDB.sqlite").toString();
  SQLiteDatabase backupDatabase = backupDBHandler.getWritableDatabase();
  backupDatabase.execSQL("ATTACH '" + DB_PATH + "' AS 'tempDb'");
  </code></pre>
  
  <p>Up until now it runs without an error.
  Then I try to create a new table in the backup database by copying it from the tempDb:</p>
  
  <pre><code>sqlDB.execSQL("CREATE TABLE my_Producent AS SELECT * FROM tempDb.my_Producent");
  </code></pre>
  
  <p>And it crashes with an error "no such table "tempDb.my_Producent" However I am sure the table exists in the database "WineDB.sqlite". I create it in onCreate method which is called before I attach the database to backupDatabase.</p>
  
  <p>Thanks for any help
  Cheers
  user2302510</p>