我试图跟随Copying data from one SQLite database to another
的第二个回答我有两节课: DatabasePayments.java和DatabaseClients.java
DatabasePayments.java:
// Database Name
private static final String DATABASE_NAME = "paymentsDatabase";
// Table name
private static final String TABLE_PAYMENTS = "payments";
DatabaseClients.java:
// Database Name
private static final String DATABASE_NAME = "clientsDatabase";
//TABLE NAMES
private static final String TABLE_CLIENTS = "clients";
我想在paymentsDatabase中使用来自clientsDatabase的数据,所以我调用的命令与来自我的问题或SQLITE ATTACH documentation的问题的链接问题的第二个答案完全相同,但我不知道我的命令是否正在调用。
C:\Users\Rafaello\AndroidStudioProjects\Debtors>sqlite3
sqlite> .open DatabaseClients.java
sqlite> .open clientsDatabase
sqlite> .open clients
sqlite>
或
sqlite> INSERT INTO paymentsDatabase.payments SELECT * FROM clientsDatabase.clients
...>
每次我写一些命令时,空sqlite>
或...>
出现,我不知道是否有效