Hello Everyone,
Hope all of you are doing well and safe.
I have a curious issue related to a sequence of sql statments using sqlite.
I have a table [geometries] and a table view [FlagsGeometries].
When I do the following sequence:
1.
CREATE TABLE "newGeometries" ( columns definition)
2.
insert into newGeometries select * from Geometries
3.
drop table if exists Geometries
4.
alter table newGeometries rename to Geometries
The last statement generates an exception:
SQL logic error - error in view FlagsGeometries: no such table: main.Geometries
This batch is running fine on some computer but failing on other one using the same set of sqlite files version.
What I have tried:
To cover the issue, I have modified the code like the following:
1.
1. <pre> CREATE TABLE "newGeometries" ( columns definition)
2.
insert into newGeometries select * from Geometries
2.5 ****
drop view if exists FlagsGeometries
****
3.
drop table if exists Geometries
4.
alter table newGeometries rename to Geometries
5.
****
CREATE VIEW [FlagsGeometries] AS select xxxxx from Geometries
****
This modification will cover the issue but why is it not working on all computers ?
Feel free to share if you have an explanation.
Thank you very much in advance.
Best regards.
MiQi