Habib
Habib

Reputation: 70

malformed database schema - SQLite with LinqPad

This one has me stumped - it worked perfectly on Friday; No system changes except for a windows update.
Today, I am connecting to the same sqlite database and am getting this error. database disk image is malformed malformed database schema (vSalesTerritory) - near "(": syntax error

I also connected to the database using DBeaver, which continues to work without complaint.

The cause is that the view definition is

CREATE VIEW vSalesTerritory(SLSTERCD, TerritoryName, Region) AS SELECT SLSTERCD, TerritoryName, Region FROM "SALESTERRITORY";

dropping and recreating the view

CREATE VIEW vSalesTerritory AS SELECT SLSTERCD, TerritoryName, Region FROM "SALESTERRITORY";

solved the problem in LinqPad too.

Upvotes: 1

Views: 778

Answers (1)

Habib
Habib

Reputation: 70

I was able to solve the problem by recreating the view, and removing the column names in the beginning

OLD: CREATE VIEW vSalesTerritory(SLSTERCD, TerritoryName, Region) AS SELECT SLSTERCD, TerritoryName, Region FROM "SALESTERRITORY";

NEW: CREATE VIEW vSalesTerritory AS SELECT SLSTERCD, TerritoryName, Region FROM "SALESTERRITORY";

Upvotes: 0

Related Questions