Re: [sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread heribert
LL Points SiblingsOf3 after your 'initial-select' to this head node? Why (and how) iterates your 'recursive-select'? SELECT Tree.* FROM Tree JOIN SiblingsOf3 ON SiblingsOf3.NextIDX = Tree.ID Best regards heribert heribert wrote: I've a tree with doubly linked items. I want

Re: [sqlite] [EXTERNAL] Recursive CTE on tree with doubly linked items

2019-03-11 Thread heribert
ree WHERE ParentIDX = (SELECT ParentIDX FROM Tree WHERE ID=?); -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von heribert Gesendet: Montag, 11. März 2019 09:08 An: 'SQLite mailing list' Betreff: [EXTERNAL] [sqlite] Recursive CTE on

[sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread heribert
I've a tree with doubly linked items. I want to get all siblings of a tree node (e.g. ID=2 or harder to implement ID=3). I tried to solve this problem with CTE of SQLite by myself - but I can not find the solution. I looked for any exemplary solution - but do not find some. DROP TABLE IF EXIST

[sqlite] How to backup a memory database to a memory stream?

2019-02-21 Thread heribert
Is there any way to backup a memory database directly to a memory stream? In my case i have to backup a small memory database directly into a byte array, without using any os based temp file. ___ sqlite-users mailing list sqlite-users@mailinglists.sq

Re: [sqlite] sqlite3_column_type returns NOT SQLITE_NULL and the following sqlite3_column_text returns with nullptr

2018-09-11 Thread heribert
h the same stmt). The main thread reads...  meanwhile the other thread access resets the stmt results... Thx again! Am 11.09.2018 um 13:58 schrieb heribert: I've a prepared select statement (the database is in :memory: based.). After binding the input values, calling next, checking the result

[sqlite] sqlite3_column_type returns NOT SQLITE_NULL and the following sqlite3_column_text returns with nullptr

2018-09-11 Thread heribert
_type returns NOT SQLITE_NULL and the following sqlite3_column_text returns with nullptr? Thx for any hint heribert ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] "cursored" queries and total rows

2018-06-04 Thread heribert
I'm using also paged queries. I'm adding an OFFSET to the select-limit query. Works for me. Am 03.06.2018 um 14:16 schrieb R Smith: On 2018/06/03 1:13 PM, Wout Mertens wrote: Hi all, To do paged queries on a query like SELECT colVal FROM t WHERE b=? LIMIT 10 I keep track of column val

Re: [sqlite] Reset the cursor

2018-06-04 Thread heribert
ooops... last answer mail was on the wrong topic. Am 04.06.2018 um 17:57 schrieb heribert: I'm using also paged queries. I'm adding an OFFSET to the select-limit query. Works for me. Am 04.06.2018 um 17:54 schrieb x: If the first loop exits with res3 == SQLITE_DONE then !result wil

Re: [sqlite] Reset the cursor

2018-06-04 Thread heribert
I'm using also paged queries. I'm adding an OFFSET to the select-limit query. Works for me. Am 04.06.2018 um 17:54 schrieb x: If the first loop exits with res3 == SQLITE_DONE then !result will be true and the second loop should process exactly the same (assuming underlying data is unchanged).

[sqlite] After update from 3.20 to 3.23 alter table throws error for boolean with default value FALSE

2018-05-17 Thread heribert
nging FALSE to 0 the command works with sqlite 3.23. 'alter table Inbox add column WasSend boolean default 0' So i looked into the SQLite keyword list... but i didn't find neither FALSE nor TRUE. So, why did the FALSE work with 3.20? Thx heribert _

Re: [sqlite] How does SQLite handle \r and \n in values?

2017-09-21 Thread heribert
rieb Simon Slavin: On 21 Sep 2017, at 5:00pm, heribert wrote: I'm using c++ and generate the whole insert string via sqlite3_vmprintf with quoted text. So the '\r' and '\n' are single characters - this will result in the error. Something is wrong with your development en

Re: [sqlite] How does SQLite handle \r and \n in values?

2017-09-21 Thread heribert
provide a minimal example of the code you used? On September 21, 2017 9:56:29 AM EDT, heribert wrote: Hello, i attempt to make a INSERT with a TEXT field containing a string with \r and \n characters, but it fails (Strings without \r and \n characters are inserted correct). The sqlite3_exec resu

[sqlite] How does SQLite handle \r and \n in values?

2017-09-21 Thread heribert
strings containing \r and \n in a TEXT field? Thx for any hint heribert ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] [EXTERNAL] Re: sqlite3_stmt limitations

2017-09-20 Thread heribert
) Prepare the statement once in each reader thread and use the bind functions to set the constraint values The writer thread will need to prepare statements to populate the db too. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftra

Re: [sqlite] sqlite3_stmt limitations

2017-09-20 Thread heribert
Values WHERE Object=? AND Property=?". Will it be better to prepare the sqlite3_stmt and reuse it? Or ondemand:  prepare, use and close the sqlite3_stmt. Is the time-consuming of parsing a statement like above too high, so it will be better to reuse the sqlite3_stmt (so i will have thousends p

[sqlite] sqlite3_stmt limitations

2017-09-19 Thread heribert
used by a sqlite3_stmt? Thx for any hint heribert ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread heribert
There are some missing spaces i think: string stCmdString = "SELECT " + stFieldNames + " FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE '%'||" + liststLikeFieldValue[0] + "||'%'"; Am 26.01.17 um 15:04 schrieb Clyde Eisenbeis: I tried replacing this: string stCmdString = "SELECT

Re: [sqlite] Using SQLite, how can I search for chars that include a ', similar to OLE DB .Parameters?

2017-01-26 Thread heribert
There are some missing spaces i think: string stCmdString = "SELECT " + stFieldNames + " FROM " + stTableName + " WHERE " + stLikeFieldName + " LIKE '%'||" + liststLikeFieldValue[0] + "||'%'"; Am 26.01.17 um 15:04 schrieb Clyde Eisenbeis: I tried replacing this: string stCmdString = "SELEC

Re: [sqlite] Cannot insert a prepared bound text containing dash/dahes

2016-11-08 Thread Heribert
; > Then verify the database: > > sqlite3 x1.db .dump > PRAGMA foreign_keys=OFF; > BEGIN TRANSACTION; > CREATE TABLE MyTable(SomeTime); > INSERT INTO "MyTable" VALUES('2016-11-01 12:00:00'); > COMMIT; > > The above was using exact

[sqlite] Cannot insert a prepared bound text containing dash/dahes

2016-11-08 Thread heribert
Currently i'm using sqlite 3.15.0. I run into the problem that a TEXT field of a TABLE cannot be bind to a string containing a dash. If i remove or replace the dash/dashes against any character the prepared and bind statement works fine. Here two code fragments. The demo table is like "crea