Re: [sqlite] [EXTERNAL] Does mmap increase PSS?

2018-04-13 Thread Hick Gunter
Just to be sure of the real issue: - your application runs just fine with a small amount of memory (2M) for most queries - a small subset of queries requires "the whole db" to be kept in memory for performance reasons - the application should revert to "small memory" when the "whole db" query is

Re: [sqlite] [EXTERNAL] Preupdate hook column name

2018-04-13 Thread Hick Gunter
name I can't do that (execute other statements) inside a sqlite3_preupdate_hook callback. On Fri, Apr 13, 2018 at 6:50 AM, Hick Gunter wrote: > See pragma table_info; > > -Ursprüngliche Nachricht- > Von: sqlite-users > [mailto:sqlite-users-boun...@mailinglists.sqli

Re: [sqlite] [EXTERNAL] kooky thought: a vm-only build (for embedded). feasible?

2018-04-15 Thread Hick Gunter
There have been some inquries on the list into executing pre-generated bytecode. If you have a fixed schema you may be able to create a valid sqlite3_stmt pointer from bytecode stored somewhere. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.

Re: [sqlite] [EXTERNAL] Re: Any operation to trigger osMunmap?

2018-04-19 Thread Hick Gunter
For PSS to become smaller, pages have to be either unmapped or evicted from main memory by the OS. Probably the only way to force SQLite to unmap the memory is to set a new mmap_size (possibly after closing and reopening the database connection, which will cause a boatload of IO that most certa

Re: [sqlite] [EXTERNAL] Window functions

2018-04-25 Thread Hick Gunter
"Window functions" aka "scrollable cursors" require that the whole result set ist stored somewhere. Or at least the current position of all of the tables/indices involved in producing it, provided that such positions are settable. You then need to keep track of how many records need to be produc

Re: [sqlite] [EXTERNAL] Window functions

2018-04-26 Thread Hick Gunter
better window bound than the implicit "unbounded preceding" can be computed by the optimizer, and this may be essential for an efficient implementation of the most common case, because then the window buffer (per-group) can be guaranteed to fit into (pre-allocated) RAM. S. On

Re: [sqlite] [EXTERNAL] copmile SQLite with extension?

2018-04-26 Thread Hick Gunter
See http://sqlite.org/loadext.html -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Thomas Kurz Gesendet: Donnerstag, 26. April 2018 14:06 An: SQLite mailing list Betreff: [EXTERNAL] [sqlite] copmile SQLite with extension?

Re: [sqlite] [EXTERNAL] Re: probably recursive?

2018-05-01 Thread Hick Gunter
Counterexample: List of Tuples: (1,1), (1,3),(3,1),(3,3),(2,2) with nX = nY = 2 (2,2) is within the "square" but needs to be removed -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Barry Smith Gesendet: Mittwoch, 02. Mai 2

Re: [sqlite] [EXTERNAL] sqlite3 not support write and read at the same time?

2018-05-02 Thread Hick Gunter
Ad 2) Yes, this is expected. SQLite uses file locking to implement transactions. Ad 1) Using WAL mode, readers can read data as it was before the write transaction started. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von k

Re: [sqlite] [EXTERNAL] Open and query sqlite db in a buffer

2018-05-18 Thread Hick Gunter
Yes. Use the sqlite shell program to open the file. Otherwise you would need to work through the whole file format documentation to decode it. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Lloyd Gesendet: Freitag, 18. Mai

Re: [sqlite] [EXTERNAL] sqlite3_progress_handler(D,N,X,P)

2018-05-24 Thread Hick Gunter
If you want elapsed milliseconds, you can set a timer and call sqlite3_interrupt() to have sqlite quit executing the query as soon as possible. This interface is based on "work done". I guess the callback routine gets called at the next "interrupt point" (which is why the number N is only appro

Re: [sqlite] [EXTERNAL] Re: sqlite3_progress_handler(D,N,X,P)

2018-05-24 Thread Hick Gunter
I can't tell without extensively looking into the source code. I expect not. From my experience I would infer that ResultRow and maybe a few other VMIs are actual "interrupt points", because complex joins of virtual tables can continue for extended periods of time (and read tons of rows) before

Re: [sqlite] [EXTERNAL] Re: database locked on select

2018-05-28 Thread Hick Gunter
It is possible to bring an external resource into SQlite by writing user-defined functions and/or virtual tables. This would allow something like: UPDATE set () = new_data() where needs_update(); With the UDF returning 1 (TRUE) if the current row (identified by the arguments) needs an update

Re: [sqlite] [EXTERNAL] Re: database locked on select

2018-05-28 Thread Hick Gunter
statements on the same connection is a valid way of using this. cheers, Torsten On Mon, May 28, 2018 at 10:25 AM Hick Gunter wrote: > It is possible to bring an external resource into SQlite by writing > user-defined functions and/or virtual tables. This would allow > something >

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Hick Gunter
Yes. If the expression is a constant integer K, then it is considered an alias for the K-th column of the result set. Columns are ordered from left to right starting with 1. There is no 0-th column, so GROUP BY 0 is "out of range", just the same as "SELECT 0 GROUP BY 31" would be. -Ursprün

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-30 Thread Hick Gunter
r, a feature I don't use. These, on the other hand, work as I would have expected: sqlite> select 0 group by cast (0 as int); 0 sqlite> select 0 group by (select 0); 0 Mark On 30/05/18 12:00, Hick Gunter wrote: > Yes. If the expression is a constant integer K, then it is considered

Re: [sqlite] [EXTERNAL] unexpected error with "GROUP BY 0"

2018-05-31 Thread Hick Gunter
sents its integer value, gets interpreted after GROUP BY or ORDER BY as a result column number. Fortunately, SQLite isn't to blame for designing this. By the way, this feature is documented for ORDER BY, but I don't see it for GROUP BY. Mark On 30/05/18 13:28, Hick Gunter wrote: > Yo

Re: [sqlite] [EXTERNAL] Re: random rows

2018-06-01 Thread Hick Gunter
Just an idea: If the table has an INTEGER PRIMARY KEY AUTOINCREMENT then then maximum rowid is available in the sqlite_sequence table. To generate a random sequence of rowids, this can be used, somewhat like SELECT DISTINCT rnd() * (SELECT seq FROM sqlite_sequence WHERE name='') as rowid; Mayb

Re: [sqlite] [EXTERNAL] Re: Subject: Re: SQL Date Import

2018-06-03 Thread Hick Gunter
Not even Microsoft Excel has a dedicated datetime/timestamp type. It is just a presentation layer attribute of a floating point value. Also, you get to choose the way you want calendar data to be stored. So why? -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mai

Re: [sqlite] [EXTERNAL] Re: Sqlite delete slow in 4GB

2018-06-06 Thread Hick Gunter
Your schema has a major flaw that is addressed in SQLite documentation: Do not put any fields after blob fields, especially if the content is typically large. SQLite accesses fields in the order of defintion, so to access your ANH_PRC_id field, it has to retrieve the 1MB ANP_VALUE blob. Putting

[sqlite] how to unsubscribe (was: Size of the SQLite library)

2018-06-06 Thread Hick Gunter
Use the links supplied at the bottom of each and every message to unsubscribe yourself -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Dianne Dunn Gesendet: Donnerstag, 07. Juni 2018 06:25 An: SQLite mailing list Betreff:

Re: [sqlite] [EXTERNAL] Re: sqlite.org website is now HTTPS-only

2018-06-07 Thread Hick Gunter
> > >Why can't we have both? I mean the software is in the public domain there is >nothing to hide so what's the point of encrypting the site? > >Cheers and thank for you generosity and work. >Best regards, >George I believe it is because of the EU GDPR, which is designed to placea disproportion

Re: [sqlite] [EXTERNAL] Selecting multiple similar columnname.

2018-06-07 Thread Hick Gunter
Adding the attribute "hidden" to a column prevents it from showing up in the expansion of '*' in the select list, while still allowing it to be queried by name. There is no RE matching in the select list; you are expected to know exactly what you want. Having multiple instances of a field or fi

Re: [sqlite] [EXTERNAL] Feature suggestion / requesst

2018-06-07 Thread Hick Gunter
> > >I've encountered a feature that I think would be awesome: >https://www.postgresql.org/docs/9.3/static/dml-returning.html > >Example: INSERT INTO blah (this, that, another) VALUES (x, y, z) RETURNING id; > What does this do if the INSERT creates multiple rows? What about inserts generated fro

Re: [sqlite] [EXTERNAL] Re: sqlite.org website is now HTTPS-only

2018-06-08 Thread Hick Gunter
R jurisdiction... -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Simon Slavin Gesendet: Freitag, 08. Juni 2018 08:37 An: SQLite mailing list Betreff: Re: [sqlite] [EXTERNAL] Re: sqlite.org website is now HTTPS-only On 8

Re: [sqlite] [EXTERNAL] Explain Query plan

2018-06-08 Thread Hick Gunter
Have you run ANALYZE? This may provide the QP with better cost estimates. LIKE and GLOB can sometimes be optimized (differently, because GLOB is case sensitive and requires COLLATE BINARY and LIKE by default is not and requires COLLATE NOCASE), in which case the index will be used. See https://

Re: [sqlite] [EXTERNAL] Re: Selecting multiple similar columnname.

2018-06-08 Thread Hick Gunter
There is probably no performance difference between inserting 1 big row with repeated data from *up to* (how do you know how many?) 64 satellites and inserting *up to* 64 records with identical timestamps WITHIN A SINGLE TRANSACTION. This will eliminate your need for wildcard matching of column

[sqlite] Does column order matter for performance?

2015-05-04 Thread Hick Gunter
Actually it does. Sort of. The beginning of the record is the "manifest" (actual type of data list) area. This contains tokens representing the actual type/contents of the fields. Sticking with the example this will be 99 bytes containing the tokens "null", "zero", "one" and "integer" followed

[sqlite] Possible bug with locking/retying

2015-05-04 Thread Hick Gunter
The obvious solution would be to statically link beets to a properly compiled SQLite library instead of relying on everybody else to get it "right" -Urspr?ngliche Nachricht- Von: Simon Slavin [mailto:slavins at bigfraud.org] Gesendet: Sonntag, 03. Mai 2015 02:18 An: General Discussion of

[sqlite] SQLite queries

2015-05-07 Thread Hick Gunter
I prefer my integers unsinged ;) SQLIte: - only signed integers up to 64 bit - arrays and structures only if you are willing to extract them from blobs via user written virtual tables - no date/time type, but you can store microsecond resolution timestamps in 64bit integers -Urspr?ngliche

[sqlite] xBestIndex() implementation question

2015-05-15 Thread Hick Gunter
You are not supposed to know the value on the RHS because that would lure you into performing lots of work that you should not be doing in the query planning step. Remember that xBestIndex may be called multiple times with different combinations of constraints. Running the equivalent of "select

[sqlite] Regarding SQLITE_PRIVATE

2015-05-15 Thread Hick Gunter
SQLITE_PRIVATE means that the function is PRIVATE. You are not allowed to call this function, it is not supported as part of the SQLite API. Because you are not allowed to call the function directly, it is not made available to the linker. You can call it indirectly through the EXPLAIN feature.

[sqlite] Regarding SQLITE_PRIVATE

2015-05-15 Thread Hick Gunter
Regarding SQLITE_PRIVATE On Fri, May 15, 2015 at 3:53 PM, Hick Gunter wrote: > SQLITE_PRIVATE means that the function is PRIVATE. How they achieved PRIVATE functions in C? You are not allowed to call this function, it is not supported as part of > the SQLite API. Because you are not all

[sqlite] Virtual Table query - why isn't SQLite using my indexes?

2015-05-18 Thread Hick Gunter
Are you setting the constraintUsage return parameters correctly? SQLite ist asking two questions: 1) What is the cost of a full table scan on table inventory (your answer is 4581; I personally would leave idxNum=0 for this case) 2) What is the least cost of doing a partial table scan with any c

[sqlite] Virtual Table query - why isn't SQLite using my indexes?

2015-05-19 Thread Hick Gunter
Eric Working backwards from your query, I think your schema would be similar to (foreign keys omitted) CREATE TABLE rental ( rentalID INTEGER PRIMARY KEY NOT NULL, rental_date TEXT, inventory_id INTEGER, customer_id INTEGER, ...); CREATE TABLE inventory ( inventory_id INTEGER PRIMARY KEY NOT NU

[sqlite] Virtual Table query - why isn't SQLite using my indexes?

2015-05-20 Thread Hick Gunter
-Urspr?ngliche Nachricht- Von: Eric Hill [mailto:Eric.Hill at jmp.com] Gesendet: Dienstag, 19. Mai 2015 22:44 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Virtual Table query - why isn't SQLite using my indexes? Hey, Gunter, ... But then what about a query like this:

[sqlite] ALTER TABLE ADD COLUMN

2015-05-21 Thread Hick Gunter
Try alter table [database] add column [real_length] numeric; -Urspr?ngliche Nachricht- Von: Christoph P.U. Kukulies [mailto:kuku at kukulies.org] Gesendet: Donnerstag, 21. Mai 2015 08:51 An: General Discussion of SQLite Database Betreff: [sqlite] ALTER TABLE ADD COLUMN I used sqlite3.e

[sqlite] Copy data between to databases unsing windows embedded compact 7, .net 3.5

2015-05-21 Thread Hick Gunter
ATTACH is the command you are looking for -Urspr?ngliche Nachricht- Von: afriendandmore [mailto:afriendandmore at ymail.com] Gesendet: Donnerstag, 21. Mai 2015 15:15 An: sqlite-users at mailinglists.sqlite.org Betreff: [sqlite] Copy data between to databases unsing windows embedded compac

[sqlite] BestIndex problem

2015-05-21 Thread Hick Gunter
None of the queries named requires more than 1 parameter to xFilter. Why should they? xBestIndex will be called once with no usable constraints and once with (value1, "="). The difference is that xFilter will be called once for each constraint value, i.e. once for query 1 and twice for queries

[sqlite] Query containing correlated subquery gets "stuck"

2015-05-27 Thread Hick Gunter
Which SQLite version? Which operating system? Where is the database file located? Local storage or network drive? WAL mode or journal mode? What does "pragma integrity_check;" return? Is there a busy handler involved (in either process)? Is there an interconnection between the two processes (e.g. p

[sqlite] Information passing between xBestIndex and xFilter

2015-11-16 Thread Hick Gunter
It is up to your xBestIndex method to confern this information to your xFilter method, e.g. by setting the idxStr return parameter in a way these methods understand (e.g. leave it pointing to a character that encodes the required comparison). The idxStr is passed to xFilter unchanged from what t

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Hick Gunter
We are using multiple processes accessing the same on-disk db with almost exclusively virtual tables. Once the tables have been declared (CREATE VIRTUAL TABLE...), all other connections need only to load the modules. The xConnect method gets called on first access. -Urspr?ngliche Nachricht

[sqlite] Problem sqlite

2015-10-06 Thread Hick Gunter
I suspect you are having a chracter encoding problem. SQLite supports UTF encoding. -Urspr?ngliche Nachricht- Von: Jonathan [mailto:jonathanmejiaa at hotmail.com] Gesendet: Dienstag, 06. Oktober 2015 15:27 An: sqlite-users at mailinglists.sqlite.org Betreff: [sqlite] Problem sqlite > Hel

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Hick Gunter
1) Each connection needs to load the image(s) that contain(s) the virtual module code (unless you have already linked it into a single image). 2) Each connection needs to declare the virtual module(s) by calling sqlite3_create_module(_v2). 3) Each connection needs to declare the tables using "CRE

[sqlite] Multiple connections to in-memory DB and virtual tables

2015-10-06 Thread Hick Gunter
AFAICT the FROM clause is superflous, as the function has no (supported) way of detecting which table(s) the FROM clause contains. What is your "reindex_virtual_table()" function (I assume it is a user implemented function) supposed to do? -Urspr?ngliche Nachricht- Von: Eduardo Morras [

[sqlite] Strange behaviour of IN/NOT IN subqueries?

2015-10-08 Thread Hick Gunter
Indeed you did reproduce in that you selected all of the 1 entries you inserted into table item and inadvertently used the field name from the table in the subquery in the NOT IN case ;) A subquery "select itemcode from tmp_salesitm", is allowed to refer to fields from the outer "select * from

[sqlite] [sqlite-dev] SQLite version 3.8.12 enters testing

2015-10-08 Thread Hick Gunter
I expect users running SQLite on embedded devices would be thrilled... -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Filip Navara Gesendet: Donnerstag, 08. Oktober 2015 15:55 An: sqli

[sqlite] Order with another sequence

2015-10-09 Thread Hick Gunter
It should be possible with a custom collation sequence. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Cecil Westerhof Gesendet: Freitag, 09. Oktober 2015 12:08 An: sqlite-users at mai

[sqlite] Problem with sqlite3_create_function

2015-10-19 Thread Hick Gunter
The "context" passed to a user defined function is not and cannot be a "statement handle". How would an aggregate function tell the difference between Select SUM(x) ... and Select SUM(x), SUM(y) ... if not by virtue of sqlite3_aggregate_context() returning different adresses? -Urspr?nglic

[sqlite] Problem with sqlite3_create_function

2015-10-21 Thread Hick Gunter
not be > > a > "statement handle". > > Yes, you are right there. Not sure now how I thought it was a > statement handle, but this doesn't alter the problem. > Thanks in any case for correcting this mis-conception. > > RBS > > On Mon, Oct 19, 2015 at 1:40

[sqlite] Problem with sqlite3_create_function

2015-10-22 Thread Hick Gunter
>> Can you reproduce the problem using the sqlite shell? >This won't be easy as the UDF is in an ActiveX dll, not in sqlite3.dlll > >This is the output from explain, run on this SQL: >SELECT XXX(F1, F2) as A, XXX(F1, F2) as B FROM UDF_TEST limit 3 XXX will just >add the results of the integer va

[sqlite] ***suspected spam*** Re: Simple Math Question

2015-10-23 Thread Hick Gunter
>17 -> 0x10001 mantissa >-1 -> 0xf exponent ( or however many bits the exponent is represented by >exact Still thinking in decimal... Value = mantissa * 2 ^ exponent And not Vale = mantissa * 10 ^ exponent ___ Gunter Hick Software Engineer Sci

[sqlite] ***suspected spam*** Re: Simple Math Question

2015-10-23 Thread Hick Gunter
>> Another good good way to think of IEEE I was presented once with, and >> which kind of gave me a ah-ah moment, is the fact that numbers with >> exact representation fall on the nodes of grid, and there's plenty of >> "space" in between the nodes for values which cannot be exactly >> represented.

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread Hick Gunter
The main difference between HAVING and WHERE ist that WHERE operates on the input set and HAVING operates on the output set. If your condition requires computing an aggregate, then HAVING is a viable method of avoiding a subquery that needs to repeatedly scan the input table: SELECT currency,pr

[sqlite] regression in 3.12.0 vs. 3.11.0, column type information in PRAGMA missing

2016-04-06 Thread Hick Gunter
You are hopefully aware of the fact that SQLite associates type with the actual values and not the containers(columns) used to hold these values? This means that a data object of any type may be held/returned in a column, irrespective of the declared type (which, for expressions, is NULL). What

[sqlite] Expecting syntax error on delete

2016-04-11 Thread Hick Gunter
The expression "a in ('abc','def')" will return either TRUE or FALSE so your condition devolves to "a in (TRUE, FALSE)" which is FALSE for all text values. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.o

[sqlite] storing coordinate pairs efficiently?

2016-04-20 Thread Hick Gunter
The "Usability" of an index for a certain set of constraints ends with the first (in the order mentioned in the index) field with an inequality constraint. However, and index on (gx,gy) is still be faster for the query shown than just on (gx), because the value of the second field is read from t

[sqlite] SELECT 0 gives TEXT instead of INTEGER

2016-04-21 Thread Hick Gunter
Try "limit 20". The hex function interprets the argument as a blob. This causes your integer value to be converted to text, and the hex representation of that text is your result. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces

[sqlite] Table entries disappearing for unknown reason.

2016-02-02 Thread Hick Gunter
Does the error still occur if you run with only one thread? Does each thread have ist own connection or are you sharing a single connection across multiple threads? -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglist

[sqlite] json_group_array

2016-02-05 Thread Hick Gunter
That is because count(a) and count(*) means two different things. The first counts values, the second counts rows. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von TJ O'Donnell Gesendet

[sqlite] json_group_array

2016-02-05 Thread Hick Gunter
mailinglists.sqlite.org] Im Auftrag von Yannick Duch?ne Gesendet: Freitag, 05. Februar 2016 12:38 An: sqlite-users at mailinglists.sqlite.org Betreff: Re: [sqlite] json_group_array On Fri, 5 Feb 2016 07:51:06 + Hick Gunter wrote: > That is because count(a) and count(*) means two differ

[sqlite] Can't understand why I need this cast

2016-02-18 Thread Hick Gunter
Consider asql> select '1' >= 1, '1' <= 1; '1' >= 1 '1' <= 1 1 0 This is because of the implicit ordering of TEXT and INTEGER values. Strftime() returns a text; in the expression "strftime() + 1" the arithmetic operator "casts" its left hand operand to integer (actual

[sqlite] Process duplicate field values

2016-02-19 Thread Hick Gunter
Basic idea, no testing The core query is Select F1 as key,count() as count from MyTable group by F1 having count>1; The number of distinct F1 values is select count() from () The number of conflict records is Select sum(count) from () And the update would be Update MyTable set F2=9 where F1

[sqlite] Multiple Column index

2016-02-19 Thread Hick Gunter
The order of fields in the multicolumn index matters. Taken in the order of fields in the index, the first inequality relation terminates the part of the index that is usable. For a constraint "plate EQUALS and date BETWEEN" you need an index on (plate,date). Your index is only usable for "date

[sqlite] EXPLAIN QUERY PLAN for non-SELECT statements?

2016-02-19 Thread Hick Gunter
-Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von nomad at null.net Gesendet: Freitag, 19. Februar 2016 11:01 An: SQLite mailing list Betreff: [sqlite] EXPLAIN QUERY PLAN for non-SELECT st

[sqlite] SQLite as calculator

2016-02-19 Thread Hick Gunter
Yes it is expected. Strings always compare greater than numbers. Arithmetic operators will apply numeric affinity to their operands, allowing e.g. the addition of a string and an integer to produce the expected result. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.s

[sqlite] How to modify page_size

2016-02-25 Thread Hick Gunter
Short answer: you can't. It would require rebuilding every single page of the database. Exception 1: If the database is empty, the pragma will set the page size. Exception 2: If your database is not empty and you run VACUUM (which rebuilds every page of the database anyway) immediately after is

[sqlite] How to modify page_size

2016-02-25 Thread Hick Gunter
Works as advertised. A database in WAL mode does not allow the page size to be changed. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Yongil Jang Gesendet: Donnerstag, 25. Februar 20

[sqlite] Can SQLite know from the statement string if it is row producing or not?

2016-01-11 Thread Hick Gunter
You may also like to consider sqlite3_stmt_readonly() which will return TRUE for all statments that do not (directly) modify the db contents -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag

[sqlite] sqlite3_wal_checkpoint_v2() returning SQLITE_LOCKED: in what circumstances?

2016-01-15 Thread Hick Gunter
I think you may mean "database connection" instead of "statement handle". When you are finished with processing a statement, you should either reset (if you intead to use it again later) or finalize it. Otherwise SQLite must assume that you want to continue later and needs to keep around whateve

[sqlite] Using sqlite3.exe as a subprocess

2016-01-18 Thread Hick Gunter
How to detect beginning and end of output from a SQL Statement piped to a subprocess: Initialize the subprocess with .header off .separator .mode list And then delimit your queries - SELECT ' START'; - - SELECT ' END'; Discarding everything not between the expected START and END lines ---

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-18 Thread Hick Gunter
AFAICT the abstract syntax tree does not exist outside of the generated lemon parser. Only the generated VDBE code makes it to the "outside world". -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im A

[sqlite] Wish list: allow developers use the power ofsqliteparser

2016-01-18 Thread Hick Gunter
This will output the steps the parser does (reduce, shift, fallback,...) but not the syntax tree. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Domingo Alvarez Duarte Gesendet: Monta

[sqlite] Retrieved Blob Data has 16 Byte Header or ?

2016-01-19 Thread Hick Gunter
Just a wild guess: The NSData object has an overhead of 16 bytes and the (overloaded/member?) sizeof() function returns the NET contents, not the total size which should be 16 bytes (the overhead) longer. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [ma

[sqlite] Wish list: allow developers use the power of sqliteparser

2016-01-19 Thread Hick Gunter
Use the documented and supported sqlite3_set_authorizer() function to achieve security vetting of SQL Statements. This calls a user-supplied function with the details of which tables and fields the user is attempting to access and if this is a read or write access. -Urspr?ngliche Nachricht-

[sqlite] UPSERT

2016-01-20 Thread Hick Gunter
REPLACE will delete the offending row in the referenced table and insert a new one with a newly generated rowid. If the foreign key references the rowid, the DELETE CASCADE will be invoked because there is no longer a record with the referenced rowid. -Urspr?ngliche Nachricht- Von: sqli

[sqlite] SQLite scans the largest table in the query where a very small table is available

2016-01-20 Thread Hick Gunter
Have you tried running ANALYZE on a representative dataset? This will determine the "shape" of your tables and allow the query planner to make better guesses of the costs associated with each join. If, after ANALYZE, you still feel the need to improve over the query planners' ordering, you can

[sqlite] Store the value from a variable into a field in database table

2016-01-22 Thread Hick Gunter
You can either printf() the statement to insert the value into the text, or use SQL variables to prepare the generic statement and sqlite3_bind_xxx() the desired value. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailing

[sqlite] Suggesting an Index to Use Can Improve Performance Even When Planner was Already Going to Use It

2016-01-25 Thread Hick Gunter
Adding the INDEXED BY changed the nesting order of the loops. Also, note the word AUTOMATIC in the query plan: This means that the QP has decided it is worthwhile to build an Index just for this one query. The first plan in English: Build an Index on T2.E = 2 that also contains the field

[sqlite] Insert or Replace Trouble

2016-03-09 Thread Hick Gunter
There is no unique constraint (express or implied) in your schema, therefore no conflict occurs and it is possible to insert as many identical rows as your diskspace will hold. -Urspr?ngliche Nachricht- Von: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at

[sqlite] jude a record is exist or not

2016-03-10 Thread Hick Gunter
Assuming the "id" is the primary key of your table "table_name", your statement will list the id of all the records present (full scan, reading every entry of the implicit primary key index). To find out if a specific record exists, use "select count() from table_name where id = " to return a s

[sqlite] Error msg help

2016-03-17 Thread Hick Gunter
It seems your 14 digit API well number is being converted to a real before being output with only 2 digits of precision, giving the string "3.11E+13". This is nearly guaranteed to NOT be unique. You need to request a CSV File with the API well number in string format. -Urspr?ngliche Nachric

[sqlite] Calling some predefined SQL function from another custom SQL function?

2016-03-31 Thread Hick Gunter
While it is technically possible to convincingly fake an SQLite context to call strftimeFunc() with, it also means that you are ignoring SQLite function overloading. And making yourself dependant on internal changes to SQLite structures that are opaque for a reason. -Urspr?ngliche Nachricht

[sqlite] Processing arguments in a user-defined function

2016-05-02 Thread Hick Gunter
The Pointer you received calling sqlite3_value_test16() on the FIRST argument is not invalidated by calling the same function on the SECOND argument. Value conversions may (and do for specific calling sequences) happen only when calling a different sqlite3_value_x() function on the SAME argument

[sqlite] Illegal SQL not rejected

2016-05-02 Thread Hick Gunter
This is the much discussed and misunderstood feature that enables SQLite to process statements like SELECT A, B, MAX(C) FROM TABLE GROUP BY B; and return the (or one of the) value(s) of A associated with the maximum value of C within each group of B in just one full table scan. By extension, t

[sqlite] strftime accepts an illegal time string

2016-05-06 Thread Hick Gunter
> >For instance, do you care if someone enters a time which is skipped by the >clocks going forward ? If at 1am your clocks skip straight to 2am, do you >care if someone enters a time of 1:30am on that >day ? > > >Simon. > Our local time skips from 2am to 3am and from 3am back to 2am for DST. T

[sqlite] Incremental backup/sync facility?

2016-05-06 Thread Hick Gunter
May I suggest using a statement log of the "primary" database to update the secondary sites? If you have a sequence counter (separate or embedded) then the state of the database could be recovered from a backup (sequence counter x) plus the log files for all statements from x+1 to "current". --

[sqlite] Incremental backup/sync facility?

2016-05-06 Thread Hick Gunter
No,you just have to log the bound parameters and a reference to the prepared statement (so the other side will know which statement to prepare). Or just log the statement & the parameters each time. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-u

[sqlite] SELECT DISTINCT question

2016-05-09 Thread Hick Gunter
This is documented behaviour for SQLite: SELECT a, MAX(b) table; Will return (one of) the a value(s) that comes from the same row as the MAX(b). If there are not exactly on of MIN or MAX aggregate functions, SQLite is free to pick any row (within a group) to return non-aggregated columns from.

[sqlite] 2 different SQLite versions inside the same process space

2016-05-11 Thread Hick Gunter
To get this effect you need to have 2 (shareable) images, each with their own and very private copy of sqlite, loaded into the same process. With the mentioned #defines that make all sqlite3 symbols become static, it is quite easy to compile sometool.c and sqlite3.c into a single sometool.so (or

Re: [sqlite] a question about data synchronization

2016-06-01 Thread Hick Gunter
Process B can see only data that is committed before it's read transaction is started. I suspect you are creating a transaction in process B right after connecting to the database that remains open for the lifetime of the connection. This will force Process B to see the state as it was before i

Re: [sqlite] Some Latin characters cannot be handled correctly

2016-06-02 Thread Hick Gunter
SQLite will faithfully return whatever sequence of bytes you passed in when inserting the data. If you insert ISO-ANSI encoded data then please do not expect the returned data to be magically converted to UTF. BTW, this mailing list does not support attachments. -Ursprüngliche Nachricht---

Re: [sqlite] UPDATE statement without FROM clause

2016-06-06 Thread Hick Gunter
Would not Replace into A () select ,, from A [cross] join B on( ); do the trick? If a.rowid has an alias (i.e. integer primary key) then the modified rows would be deleted, but reinserted with their respective previous rowids. This may required switching foreign keys off fort he duration of t

Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Hick Gunter
As already stated, this is not a problem of SQLite. SQLite assumes all input to be correctly encoded in UTF (unicode), the precise flavor of which may be set (once, between creating a db file and the first insert) by a pragma. If you insert ISO (latin) encoded strings, SQLite will faithfully re

Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-08 Thread Hick Gunter
That the same character is found in both encodings is no surprise. You need to look at the actual sequence of bytes. Comparing a file containing just the "capital A with diaresis" yields A 1 Byte sequence 0xC4 in ANSI A 2 Byte sequence 0xC384 in en_US.UTF8 on a RH5 linux system A 3 Byte Sequence

Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-08 Thread Hick Gunter
Yes, I missed the trailing 00 -Ursprüngliche Nachricht- Von: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Jean-Christophe Deschamps Gesendet: Mittwoch, 08. Juni 2016 09:37 An: SQLite mailing list Betreff: Re: [sqlite]

Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-15 Thread Hick Gunter
The answer is very simple: Do not use ANSI/ISO encoding with SQLite. SQLite expects Unicode. -Ursprüngliche Nachricht- Von: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Wang, Wei Gesendet: Mittwoch, 15. Juni 2016 04:44

Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-15 Thread Hick Gunter
supported for Unicode There are some unintelligible text in my database. Is there any methods to see their byte sequence? Best Regards, Wang Wei -Original Message- From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Hick

Re: [sqlite] sqlite3_column_origin_name for INSERT and UPDATE

2016-06-17 Thread Hick Gunter
Does .pragma table_info(); not solve your problem? -Ursprüngliche Nachricht- Von: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Rapin Patrick Gesendet: Freitag, 17. Juni 2016 10:57 An: sqlite-users@mailinglists.sqlite.

Re: [sqlite] Conversion failure

2016-06-23 Thread Hick Gunter
Open the editor application, type in your command, save to file and the view with a hex editor. I suspect it will be in ISO encoding. -Ursprüngliche Nachricht- Von: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Igor Koro

<    1   2   3   4   5   6   7   8   9   10   >