Page 1 of 1

SQL script for created VIEW in database wrong?

Posted: Wed 06 Jul 2011 15:24
by Peter Kuhn
Hello,

I created a simple database (SQLite) with a Table and a View. For the View I used the following script:

Code: Select all

CREATE VIEW ProductSlim AS  
SELECT ID, Name FROM Product
If I import my database, I can see the table and the view in the “Database Explorer” which is separated in two categories:
Database Connection --> main --> Tables --> Product
Database Connection --> main --> Views --> ProductSlim

If I try the function “Generate Database Script From Model” I see that my View is converted to a table:

Code: Select all

-- 
-- Creating a table "main".ProductSlim
-- 
CREATE TABLE "main".ProductSlim (
   ID INTEGER,
   Name TEXT
);
Is there any possibility to avoid this conversion?

regards
Peter Kuhn

Posted: Thu 07 Jul 2011 09:37
by AndreyR
Unfortunately, the model does not contain the information that is necessary for the view script generation (namely, we don't have any information about the table(s) the SELECT statement is applied to).