Search notes:

SQLite: views

No validity check at creation time

When a view is created, the »executability« of the select statement is not checked.
In the following code snippet, the create view … statement compiles fine, although the selected columns col_one and col_two don't even exist in the base table tq84_tab:
create table tq84_tab (
  col1,
  col2
);

create view tq84_vw as
select
  col_one,
  col_two
from
  tq84_tab;

select * from tq84_vw;
--
-- Error: … no such column: col_one

drop view tq84_vw;
drop table tq84_tab;
Github repository about-sqlite, path: /views/no-validity-check.sql

See also

drop view

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758198755, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/views/index(64): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78