Sqlite issues with views... lazarus / 63-Database ---------------------------------------------------------------------- helio · 2016-11-28 11:30 What is the correct way to create a view in sqlite, according to the sqlite manual I can use these two types below Table =>  CREATE TABLE "test" ("column1" TEXT, "column2" TEXT, "column3" TEXT) 1 => CREATE view "test_view" (col1, col3) as select "column1", "column3" from "test" 2 => CREATE view "test_view" as select "column1" as col1, "column3" as col3 from "test" What's wrong with sqldb? Error in 1 statement!!! ---------------------------------------------------------------------- eny · 2016-11-28 15:37 Maybe a semicolon after each line? ---------------------------------------------------------------------- helio · 2016-11-28 16:36 CREATE view "test_view" (col1, col3) as select "column1", "column3" from "test" If I create the VIEW like this with above, I can not make select in any other table of the bank .... but the bank is not corrupted because I can access it with another tool; ---------------------------------------------------------------------- vrull · 2016-11-28 19:36 I agree, when I tried to create a view with syntax (1) I also got an error message - SQLite was not happy with column list. Maybe it is Lazarus-specific issue. Syntax (2) works just fine. Stick to it. About not able to open other tables - maybe you locked the database. Do you have closing transaction in your code? ---------------------------------------------------------------------- helio · 2016-11-29 09:41 No, no lock... the error is in reading the schema... ---------------------------------------------------------------------- GAN · 2017-02-16 02:11 Quote from: helio on November 28, 2016, 12:30:14 pmWhat is the correct way to create a view in sqlite, according to the sqlite manual I can use these two types below Table =>  CREATE TABLE "test" ("column1" TEXT, "column2" TEXT, "column3" TEXT) 1 => CREATE view "test_view" (col1, col3) as select "column1", "column3" from "test" 2 => CREATE view "test_view" as select "column1" as col1, "column3" as col3 from "test" Must be: 1- Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i CREATE VIEW test_view AS SELECT column1, column2 FROM test;  2- Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i CREATE VIEW test_view2 AS SELECT column1 AS col1, column3 AS col3 FROM test;  Please check it and post results.