drop table if link view error pragma_table_info view

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

drop table if link view error pragma_table_info view

Kirill-5
Hello

If you delete a table that is associated with a view.
An error occurs when calling pragma_table_info

Example:
CREATE TABLE COMPANY(
   ID INT PRIMARY KEY     NOT NULL,
   NAME           TEXT    NOT NULL,
   AGE            INT     NOT NULL,
   ADDRESS        CHAR(50),
   SALARY         REAL
);

CREATE VIEW COMPANY_VIEW AS
SELECT ID, NAME, AGE
FROM  COMPANY;

DROP table 'COMPANY';

pragma table_info('COMPANY_VIEW');

Error: Uncaught Error: no such table: main.COMPANY

As an option to automatically destroy all connected VIEW


--
Best regards,
  Kirill
  mailto:[hidden email]

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users