# SQLite Forum

Timeline

## 50 most recent forum posts by user knu

 2021-11-29 17:16 • Reply: using a | as separator does not parse into columns during import, please help out (artifact: 4d8fcb1fe3 user: knu) It works for me with this script: sqlite3 test.sqlite -version sqlite3 test.sqlite < .tables t1 sqlite> -- .tables ...> ; sqlite> SELECT name FROM sqlite_schema; t1 sqlite> -- SELECT name FROM sqlite_schema; ...> ; sqlite>  Observed behavior: Line starting with -- requires continuation, and a ';' to complete. Expected behavior: No continuation prompt. Same behavior when processing redirected scripts with single line comments, as in: sqlite3 test.db in.tmp <pragma0.txt for p in $(cat relevant_pragmas) ; do printf ".print %s::\nPRAGMA %s;\n" "$p" "\$p" ; done | sqlite3 yourdb.sqlite >pragma1.txt diff -u pragma0.txt pragma1.txt -- Regards, Kees  2021-03-16 01:42 • Reply: Serious problems with STORED columns (artifact: c545226a94 user: knu) Unlike a VIRTUAL column that is computed on the fly, a generated STORED column is actual stored data and as such it must survive dumps, i.e., it must be possible to restore to the exact same content it had before a DUMP. That would be hard, as a dump file just contains DDL and INSERT statements. And you can't INSERT : insert into log(dt,msg) VALUES ('somestamp','c'); Error: near line ...: cannot INSERT into generated column "dt"  AFAIC, a solution is needed for that. The current behavior in my eyes is buggy! A solution is available in the backup interface and the VACUUM INTO statement. 2021-03-12 08:30 • Reply: How to READ and WRITE an image to an SQLITE BLOB FIELD (artifact: 9ae1d26e28 user: knu) I don't have any working code and this is not the place to discuss it. A web search for "PHP sqlite database store image file tutorial" returns quite a few examples. Many are about MySQL, but the mechanisms are mostly the same. A PHP forum or usenet group would be a better place to ask. 2021-03-11 21:06 • Reply: How to READ and WRITE an image to an SQLITE BLOB FIELD (artifact: 6167f4d8bf user: knu) The reference material says: 7.3. File I/O Functions The command-line shell adds two application-defined SQL functions that facilitate reading content from a file into a table column, and writing the content of a column into a file, respectively. So, those functions are part of the SQLite shell, and are not in the SQLite library by default. The SQLite library that PHP offers will not have them either, because it doesn't need them. You will have to use PHP functions to read the image into memory and bind it as a BLOB to your prepared INSERT statement, and the other way around for SELECT. 2021-02-27 12:48 • Delete reply: BUG Precompiled sqlite shell for windows can't open filenames with unicode chars (artifact: 4ac1166b90 user: knu) Deleted 12:37 • Reply: BUG Precompiled sqlite shell for windows can't open filenames with unicode chars (artifact: da23e11181 user: knu) But I'm using a old version of windows, which doesn't have well support of 'chcp 65001', We can't solve that for you. Codepage 65001 was already available in Windows XP. This article may help you. and I'd like drag database to the icon of sqlite.exe. It would be appreciated if precompiled sqlite shell have native unicode support. As far as I know, the precompiled shell has native unicode support, but it depends on the Windows "terminal". Try this: Make a new shortcut (icon) which does not point to sqlite3.exe, but to a .cmd file that you write yourself, which sets up the environment for sqlite. Something like: @echo off chcp 65001 disk:\path\to\sqlite3.exe "%1"  (untested) 2021-02-10 12:45 • Reply: SAVEPOINTS (artifact: 4c7e9a3c76 user: knu) According to the syntax diagram for CREATE TRIGGER, SAVEPOINT is not a supported statement. You can make a trigger execute conditionally with the WHEN expr syntax. Also, RAISE() can influence the result of the statement that caused the trigger to fire. By the way, your code example does not represent a trigger definition, and it is unclear what problem you experience. 2021-01-25 15:35 • Reply: external pages or resources returned a 403 HTTP status code (artifact: 8ac4e6ed74 user: knu) I have a similar construction, but I generate the site from a local clone of the sqlitedoc repository. Then I run a postprocessing script over the generated html pages to replace any references to sqlite.org with links to my local site. 2021-01-24 22:42 • Reply: external pages or resources returned a 403 HTTP status code (artifact: 1a528b630f user: knu) Yes, sqlite.org has protections in place to prevent bots from (recursively) iterating over all links in the web site. In my opinion, your tool should not try to follow external links. Any content of sqlite.org is not part of your website and should not be analyzed by your tool. It is perfectly fine to have hyperlinks to sqlite,org on your site, and your users are free to click them. But the tools should not do that. Just my two cents. 08:51 • Reply: Cannot change my email settings (artifact: 4c4bb3b65c user: knu) Other forums that I use allow me to request email notifications of replies to any thread that I have posted to or replied to. I use filters in my email client whenever I need that. The forum does not need to know which posts I have read to do this: it only needs to know which threads I have posted or replied to, which can be found by a search. The forum software is discussed on the fossil forum . Your patches might be considered, if processor and I/O load are not excessive. 2021-01-23 15:23 • Reply: sqlite3_exec: the 3rd argument (artifact: f5e410ce9a user: knu) Please refer here for my code (also, note the response/advice the callback interface is rarely the best way to do something even in C. That stackoverflow post only shows the function headers, not the actual processing code. 2021-01-08 15:50 • Reply: Additional Delimiter Support for the CSV Virtual Table Module (artifact: ef8b7677b5 user: knu) Other separators are supported by the sqlite3 shell. Consider this script: #!/bin/bash set -x # echo commands rm -f test.db* test.csv # clean start # create colon delimited input file cat >test.csv <