sqlite:只读数据库中的临时表/视图? [英] sqlite: temporary table/view in a read-only db?
本文介绍了sqlite:只读数据库中的临时表/视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
似乎sqlite不允许我在只读数据库中创建一个临时视图.我想念什么吗?如果是临时的,我认为数据库连接模式无关紧要.
It seems that sqlite won't allow me to create a temporary view in a read-only db. Am I missing something? If it's TEMPORARY, I figured db connection mode shouldn't matter.
我什至指定了"PRAGMA temp_store = MEMORY"-它没有帮助.
I even specified "PRAGMA temp_store = MEMORY" -- it didn't help.
除了使用视图之外,还有其他合理的选择吗?
Is there a reasonable alternative to using views?
推荐答案
您可以创建一个引用主数据库中数据的临时视图.
You can create a temporary view that references data in the main db.
CREATE VIEW temp.userview AS select userid, firstname, lastname from main.usertbl;
然后像这样访问视图...
Then access the view like such...
SELECT * from temp.userview;
这篇关于sqlite:只读数据库中的临时表/视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文