开发者

How to add data from table of one database into table of another database in SQLite

开发者 https://www.devze.com 2023-04-03 06:23 出处:网络
Suppose I have two database files a.sqlite and other one is b.sqlite. suppose table1 is in a.sqlite and table2 in b.sqlite. I open a.sqlite in read-only mode and b.sqlite in read-write.Suppose both ta

Suppose I have two database files a.sqlite and other one is b.sqlite. suppose table1 is in a.sqlite and table2 in b.sqlite. I open a.sqlite in read-only mode and b.sqlite in read-write.Suppose both table table1 and t开发者_StackOverflow中文版able2 has same column name "description".table2 has description column with all null values and table1 has some values.So how can i add the data from table1 into table2.I know through query.But as these r in two different databse,so is there ant problem? Can any one suggest ?


Not sure if your environment allows it, but ATTACH DATABASE is normally the way to go:

http://www.sqlite.org/lang_attach.html

0

精彩评论

暂无评论...
验证码 换一张
取 消