开发者

sqlite: temporary table/view in a read-only db?

开发者 https://www.devze.com 2023-01-10 08:35 出处:网络
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.

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.

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;
0

精彩评论

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