Search notes:

SQLite: WITH clause

with W as (
   select 1, 2
)
select *
from
   W;

insert

create table tq84_1000_records (
  id integer primary key
);

with num_generator(n) as (
     select 1 n union all
     select 1+n from num_generator
     limit  1000
)
insert into tq84_1000_records
select n from num_generator;

select count(*) from tq84_1000_records;
--
-- 1000

drop table tq84_1000_records;
Github repository about-sqlite, path: /sql/with/insert.sql

See also

Recursive queries

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...', 1758206418, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/sql/with/index(63): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78