Dear fellow users and developers of SQLite,

sqlite> create table dual(dummy blob);
sqlite> insert into dual values ('SQLite version 3.8.11.1 2015-07-29 20:00:57');
sqlite> create table z4usm1 as select (unicode(substr(type,2,1)) - 97) / 4 "zk",
   ...>                        name "zn", rootpage "zp", tbl_name "zt" from 
sqlite_master; 
Error: database disk image is malformed

-- relevant part of .dbinfo
number of tables:    1
number of indexes:   0
number of triggers:  0
number of views:     0
schema size:         29

I found a work-around by creating a view (actually my first intention, because 
that is what it actually is), but 
  if you really want to create a table this way how to achieve that?

sqlite> pragma page_size=512;
sqlite> create table dual(dummy blob);
sqlite> insert into dual values ('SQLite version 3.8.11.1 2015-07-29 20:00:57');
sqlite> create view z4usm0 as select (unicode(substr(type,2,1)) - 97) / 4 "zk",
   ...>                        name "zn", rootpage "zp", tbl_name "zt" from 
sqlite_master; 
sqlite> .he on
sqlite> select * from z4usm0;
zk|zn|zp|zt
0|dual|2|dual
2|z4usm0|0|z4usm0

-- relevant part of .dbinfo
number of tables:    1
number of indexes:   0
number of triggers:  0
number of views:     1
schema size:         182

sqlite> .sh ls -lg m?.sq?
-rw-r--r--  1 staff  1024  9 Set 11:20 m0.sqb
-rw-r--r--  1 staff  2048  9 Set 11:10 m1.sqb


Another question: When can I see type 'meta' (would result in zk=1) [ exists 
according to https://www.sqlite.org/cli.html#fileio ] ?


Kind regards |?Cordiali saluti | Vriendelijke groeten | Freundliche Gr?sse,
Klaas `Z4us` V ?- OrcID 0000-0001-7190-2544

Reply via email to