Re: [sqlite] Choosing one value from the group with priority

2019-02-12 Thread Ivan Krylov
e general cases later (if ever). -- Best regards, Ivan ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Choosing one value from the group with priority

2019-02-12 Thread Ivan Krylov
er of decreasing priority from an array in my application, though I lose cross-database portability (is there a portable way to pass an array to a parameterized query, though?) and may lose some of the performance to the JOIN (didn't build a sample application to run EXPLAIN QUERY PLAN, sorry)

[sqlite] Choosing one value from the group with priority

2019-02-12 Thread Ivan Krylov
effective way to express my query? Can the more general problem of assigning a priority to all sources (e.g. "I want records from source_id 3, otherwise 1, otherwise 2") be solved in a similar way? -- Best regards, Ivan ___ sqlite-users ma

[sqlite] Bug

2017-11-22 Thread Ivan De La Cruz
SQLiteDataAdapater is dropping characters after a space in the field when filling a datatable (c# winforms). I.e. Field : 100 ml Select returns

[sqlite] Cannot compile SQLite amalgamation with MDK-ARM (Keil)

2015-10-16 Thread Ivan Kyb
Cannot compile SQLite amalgamation with MDK-ARM (Keil). I have met errors: |..\..\Libraries\sqlite-amalgamation-3081101\sqlite3.c(25838):error:#5:cannot opensource input file"sys/types.h":No such fileordirectory ..\..\Libraries\sqlite-amalgamation-3081101\shell.c(59):error:#5:cannot opensource

[sqlite] /tmp

2012-11-03 Thread Ivan Shmakov
> Richard Hipp writes: > On Fri, Nov 2, 2012 at 6:44 PM, Tod Olson wrote: […] >> This is fine on small data, but when I load 1.8GB of data (8.8 >> million rows) the second CREATE fails, reporting a disk I/O error. > You might be running out of /tmp space. Do you have plenty of /tmp

Re: [sqlite] INSERT OR IGNORE safety?

2012-11-02 Thread Ivan Shmakov
>>>>> Igor Tandetnik writes: >>>>> Ivan Shmakov <oneing...@gmail.com> wrote: >>>>> Igor Tandetnik writes: >>> Note that ending up in the IGNORE branch of INSERT OR IGNORE >>> statement doesn't constitute failure, but normal ex

Re: [sqlite] INSERT OR IGNORE safety?

2012-11-02 Thread Ivan Shmakov
> Igor Tandetnik writes: […] > Note that ending up in the IGNORE branch of INSERT OR IGNORE > statement doesn't constitute failure, but normal execution. The same > is true for INSERT ... SELECT statement where SELECT returns zero > rows so nothing is actually inserted. Thus

Re: [sqlite] INSERT OR IGNORE safety?

2012-11-02 Thread Ivan Shmakov
>>>>> Ivan Shmakov writes: >>>>> Simon Slavin writes: >>>>> On 2 Nov 2012, at 8:58am, Ivan Shmakov wrote: >>> INSERT OR IGNORE INTO "foo" ("foo") >>> VALUES (?1); >>> INSERT INTO "bar"

Re: [sqlite] INSERT OR IGNORE safety?

2012-11-02 Thread Ivan Shmakov
>>>>> Simon Slavin writes: >>>>> On 2 Nov 2012, at 8:58am, Ivan Shmakov wrote: >> INSERT OR IGNORE INTO "foo" ("foo") >> VALUES (?1); >> INSERT INTO "bar" ("foo") >> VALUES ((SELECT f.&qu

Re: [sqlite] INSERT OR IGNORE safety?

2012-11-02 Thread Ivan Shmakov
>>>>> Clemens Ladisch writes: >>>>> Ivan Shmakov wrote: >> I wonder if I'm on safe side when I use, say: >> INSERT OR IGNORE INTO "foo" ("foo") >> VALUES (?1); >> I mean, if the first INSERT fails for

[sqlite] INSERT OR IGNORE safety?

2012-11-02 Thread Ivan Shmakov
I wonder if I'm on safe side when I use, say: INSERT OR IGNORE INTO "foo" ("foo") VALUES (?1); INSERT INTO "bar" ("foo") SELECT f."rowid" FROM "foo" f WHERE f."foo" = ?1; (within a transaction) against the following schema: CREATE TABLE "foo" ("foo" TEXT

Re: [sqlite] Bug report: Out-Of-Memory error when doing DELETE from a table with 150 million records

2012-10-18 Thread Ivan P
current problem, but solving SQLite inability to work with large data sets. On Thu, Oct 18, 2012 at 12:12 AM, Richard Hipp <d...@sqlite.org> wrote: > On Wed, Oct 17, 2012 at 11:58 AM, Ivan P <iva...@cloudberrylab.com> wrote: > > > Hello! > > > > I've got Out-Of-M

Re: [sqlite] Bug report: Out-Of-Memory error when doing DELETE from a table with 150 million records

2012-10-18 Thread Ivan P
ks for about 10 minutes on my not loaded i5-2400 3.1Ghz, reaching by this moment about 1.7Gb of memory in task manager, and then fails. On Wed, Oct 17, 2012 at 8:44 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 17 Oct 2012, at 4:58pm, Ivan P <iva...@cloudberrylab.com> w

[sqlite] Bug report: Out-Of-Memory error when doing DELETE from a table with 150 million records

2012-10-17 Thread Ivan P
Hello! I've got Out-Of-Memory error when delete records from a table that has about 150,000,000 records. The table is created as: CREATE TABLE differential_parts_temp (plan_id TEXT, [version_id] INT NOT NULL, [page_index] INT NOT NULL, [md5low] INT64 NOT NULL, [md5high] INT64 NOT NULL); CREATE

Re: [sqlite] BLOB concatenation?

2012-01-20 Thread Ivan Shmakov
> Pavel Ivanov writes: [...] >> Unfortunately, the string concatenation operator, when applied to >> two BLOB's, results in a text string instead of a BLOB, like: >> SELECT quote (X'5445' || X'5354'); => 'TEST' > Maybe the following? > SELECT quote(cast(X'5445' || X'5354' as blob));

[sqlite] BLOB concatenation?

2012-01-20 Thread Ivan Shmakov
With substr (), it's possible to split a BLOB, like: SELECT quote (substr (X'1337cafe', 3, 2)); => X'CAFE' However, how do I concatenate two blobs? Unfortunately, the string concatenation operator, when applied to two BLOB's, results in a text string instead of

Re: [sqlite] Efficient usage of sqlite

2012-01-02 Thread Ivan Shmakov
> Baruch Burstein writes: […] > My resources are a bunch of sound and image files, level data files, > script files and other game data stuff. Instead of distributing my > game with about 20-30 small (some very small) files, I thought I > would roll all the files into some kind of

Re: [sqlite] transparent compression implementations for SQLite?

2011-12-31 Thread Ivan Shmakov
>>>>> Simon Slavin <slav...@bigfraud.org> writes: >>>>> On 31 Dec 2011, at 4:56pm, Ivan Shmakov wrote: >> The integers could take up to 32 bits long, but I deem them likely >> to “cluster”, like, e. g.: 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 101, 101,

Re: [sqlite] transparent compression implementations for SQLite?

2011-12-31 Thread Ivan Shmakov
>>>>> Roger Binns writes: >>>>> On 30/12/11 20:10, Ivan Shmakov wrote: >> The problem is that I have a table, each row holding something like >> 64 bytes of data (of BLOB and INTEGER types), which don't seem too >> compressible, but these rows

Re: [sqlite] transparent compression implementations for SQLite?

2011-12-31 Thread Ivan Shmakov
>>>>> Simon Slavin writes: >>>>> On 31 Dec 2011, at 7:11am, Ivan Shmakov wrote: >> Download the code and prebuilt DLL. > It includes both. In other words, the vfs_compress.c file you asked > for is in there. Indeed

Re: [sqlite] transparent compression implementations for SQLite?

2011-12-30 Thread Ivan Shmakov
>>>>> Simon Slavin writes: >>>>> On 31 Dec 2011, at 4:10am, Ivan Shmakov wrote: >> I wonder, if anyone has any experience with [1] (and where could one >> get the vfs_compress.c file, BTW?), or any other transparent >> compression implementat

[sqlite] transparent compression implementations for SQLite?

2011-12-30 Thread Ivan Shmakov
I wonder, if anyone has any experience with [1] (and where could one get the vfs_compress.c file, BTW?), or any other transparent compression implementations for SQLite? The problem is that I have a table, each row holding something like 64 bytes of data

Re: [sqlite] create sqlite3_value * from scratch?

2011-10-12 Thread Ivan Shmakov
>>>>> Pavel Ivanov writes: >>>>> On Wed, Oct 12, 2011 at 11:12 AM, Ivan Shmakov wrote: […] >> Consider, e. g.: >> sqlite3_value *a >> = sqlite3_int64_value (1); >> assert (a != 0); >> sqlite3_value *b >> = sqlite3_text_

Re: [sqlite] create sqlite3_value * from scratch?

2011-10-12 Thread Ivan Shmakov
>>>>> Igor Tandetnik writes: >>>>> Ivan Shmakov <i...@gray.siamics.net> wrote: >> I wonder, is it possible to create sqlite3_value * from scratch >> from within SQLite library's user code? > There's a circuitous route that leads there.

[sqlite] create sqlite3_value * from scratch?

2011-10-12 Thread Ivan Shmakov
I wonder, is it possible to create sqlite3_value * from scratch from within SQLite library's user code? The idea is as follows. The current dbtriv.c [1] code has a db_triv_exec_bound () function, used roughly as follows: /* sqlite3 *db; */ const char *sql

[sqlite] DISTINCT vs. UNIQUE INDEX, and NOT EXISTS vs. EXCEPT

2011-10-12 Thread Ivan Shmakov
>>>>> Jim Morris writes: >>>>> On 10/6/2011 10:43 PM, Ivan Shmakov wrote: >>>>> Jim Morris writes: […] >>> INSERT INTO fts3_table (a,b,c) >>> SELECT 'an A','a B','a C' >>> WHERE NOT EXISTS >>> (SELE

Re: [sqlite] How to design this table?

2011-10-10 Thread Ivan Shmakov
> Simon Slavin writes: > On 9 Oct 2011, at 3:57am, 张一帆 wrote: >> i have some data like "a and b or c ...",there will be a word 'and' >> or 'or' which means the Logical relations between each item. > If you have "a and b or c" does that mean > (a and b) or cOR > a and (b or c)

Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-06 Thread Ivan Shmakov
> Jim Morris writes: > The recent thread may relate: "[sqlite] Is there an efficient way to > insert unique rows (UNIQUE(a, b, c)) into an fts3 virtual table?" > INSERT INTO fts3_table (a,b,c) > SELECT 'an A','a B','a C' > WHERE NOT EXISTS > (SELECT DISTINCT a,b,c > FROM fts3_table >

Re: [sqlite] ensuring uniqueness of tuples spanning across multipletables?

2011-10-04 Thread Ivan Shmakov
>>>>> Igor Tandetnik <itandet...@mvps.org> writes: >>>>> Ivan Shmakov <i...@gray.siamics.net> wrote: >> This structure is, obviously, could just as well be represented >> with, e. g.: >> CREATE TABLE "foo" ( >&g

[sqlite] ensuring uniqueness of tuples spanning across multiple tables?

2011-10-04 Thread Ivan Shmakov
Well, this case is somewhat weird. I have a number of tables like: PRAGMA "foreign_keys" = 1; CREATE TABLE "foo-L" ( key INTEGER PRIMARY KEY REFERENCES "foo" (key), value INTEGER NOT NULL); Which are tied to a single table, like: CREATE TABLE

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Ivan Shmakov
>>>>> Igor Tandetnik writes: >>>>> Ivan Shmakov <i...@gray.siamics.net> wrote: >>>>> Tobias Vesterlund writes: >>> Is it possible to get the highest value in a "limited column" when >>> using LIMIT? >> Su

Re: [sqlite] max() with LIMIT

2011-08-31 Thread Ivan Shmakov
> Tobias Vesterlund writes: […] > If I do SELECT max(id) FROM t; it will return 99. > If I do SELECT id FROM t WHERE id > 0 LIMIT 10; it will return > 1,2,3,4,5,6,7,8,9,10 > But If I do SELECT max(id) FROM t WHERE id > 0 LIMIT 10; it will > return 99. > My logic, which may be flawed

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Ivan Shmakov
> Pete Helgren writes: > I may end up going this direction, at the moment I am not having much > luck with the conditional copy in Busybox. Your suggestion: > cp -n newdatabase.db /data/newdatabase.db > Isn't supported in the version of Busybox that I am running. Also > the script

[sqlite] sqlite_temp_master vs. .dump (now a library, too!)

2011-08-28 Thread Ivan Shmakov
>>>>> Roger Binns writes: >>>>> On 08/16/2011 04:59 PM, Ivan Shmakov wrote: […] >> Also, are the .dump and .read commands implemented as part of >> the sqlite3 binary, or are they part of the library? > They are part of the standalone shell (i

Re: [sqlite] SQL ROWNUM option is failed - Want to Read records in chunks from table

2011-08-26 Thread Ivan Shmakov
> Tarun writes: […] > I planned to execute query that works on SQL ROWNUM option > "select * from employee2 where rownum > 1 and rownum < 2" Perhaps: SELECT * FROM employee2 ORDER BY oid LIMIT 1 OFFSET 1 > but i m getting error from sqlite3 that "no such

Re: [sqlite] type of a value bound by sqlite3_bind_blob ()?

2011-08-20 Thread Ivan Shmakov
>>>>> Ivan Shmakov writes: >>>>> Roger Binns writes: […] >> Consequently if you had a trigger pulling a stunt like this, your >> code could try to insert a blob and silently (wrongly) end up with a >> string. SQLite won't even complain if th

Re: [sqlite] type of a value bound by sqlite3_bind_blob ()?

2011-08-19 Thread Ivan Shmakov
>>>>> Roger Binns writes: >>>>> On 08/17/2011 09:25 PM, Ivan Shmakov wrote: >> Somehow, I've assumed that sqlite3_bind_blob () will bind a >> parameter to a blob. > It does. There are no affinity rules that will cause otherwise. > There are

[sqlite] type of a value bound by sqlite3_bind_blob ()?

2011-08-17 Thread Ivan Shmakov
>>>>> Roger Binns writes: >>>>> On 08/16/2011 04:59 PM, Ivan Shmakov wrote: >> In the sqlite3's .dump command's output, the binary blobs may either >> be represented as hexadecimal X''-literals, or as text strings. […] > I suggest using typeof

[sqlite] forcing X'' literals in sqlite3's .dump?

2011-08-16 Thread Ivan Shmakov
In the sqlite3's .dump command's output, the binary blobs may either be represented as hexadecimal X''-literals, or as text strings. I wonder, how do I force sqlite3(1) to exclusively use the X'' representation? Also, are the .dump and .read

Re: [sqlite] Serialising memory DB

2006-05-10 Thread Ivan Voras
--- "Brandon, Nicholas (UK)" <[EMAIL PROTECTED]> wrote: > > Is there a way to serialise a memory DB so that it > can be sent over a > network socket and re-opened on another computer as > a memory DB? > > I was thinking of using a SQLite table as a > configuration system (like a > .ini file)

Re: [sqlite] How to get the lastest version of SQLITE with PHP ???

2006-05-09 Thread Ivan Voras
--- Night Media LTD <[EMAIL PROTECTED]> wrote: > Hello John, and thanks for the idea. > > > > But PHP DB is only an abstraction layer, it need a > sqlite extention to work > with sqlite database. And this extension only exist > at present in pecl of > The sqlite 2. How did you come to this

Re: [sqlite] How to get the lastest version of SQLITE with PHP ???

2006-05-08 Thread Ivan Voras
--- Night Media LTD <[EMAIL PROTECTED]> wrote: > Its incredible that a big language as PHP cannot > have the lastest version of > sqlite running with... Maybe the time has come to ask you why do you need the latest version of sqlite? Version 2.8 is widely used and as far as I can see works ok

Re: [sqlite] How to get the lastest version of SQLITE with PHP ???

2006-05-07 Thread Ivan Voras
--- Night Media LTD <[EMAIL PROTECTED]> wrote: > > Release What has changed? > > 1.0.1 - Updated libsqlite in ext/pdo_sqlite to > 3.2.8. (Ilia) >From the source of config.m4 in ext/pdo_sqlite: --with-pdo-sqlite[=DIR] PDO: sqlite support. DIR is the sqlite base directory, the bundled sqlite

Re: [sqlite] R�f. : Re: [sqlite] How to get the lastest version of SQLITE with PHP ???

2006-05-07 Thread Ivan Voras
--- Night Media LTD <[EMAIL PROTECTED]> wrote: > > > Already tested but this not worked. > > Because in fact pdo_sqlite look have is own sqlite > library into > Php_source_dir/ext/pdo_sqlite/sqlite I was talking about the PECL PHP extension. Don't know about the bundled one.

Re: [sqlite] SQLite :memory: performance difference between v2 and v3?

2006-05-05 Thread Ivan Voras
> In any case we seem to be settling to a long term > sustained rate of > about 40 flushes per second for WinXP. Since SQLite > is getting only 10 > inserts per second, it seems to me that SQLite must > be doing about 4 > flushes per insert. Does that seem right to you > Richard? For what

Re: [sqlite] SQLite :memory: performance difference between v2 and v3?

2006-05-04 Thread Ivan Voras
--- Dennis Cote <[EMAIL PROTECTED]> wrote: > All, > > More mysteries. To investigate this low insert > performance under WinXP I > wrote a simple test program that loops writing one > character to a file > and then flushing the file. The strange thing is > that it seems to > alternate between

Re: [sqlite] SQLite :memory: performance difference between v2 and v3?

2006-05-03 Thread Ivan Voras
> > profile results with dirty pages fix: > > > > % cumulative self self > total > > time seconds secondscalls ms/call > ms/call name > > 9.20 0.31 0.31 100011 0.00 > 0.03 sqlite3VdbeExec > > 7.42 0.56 0.25 4849544 0.00

Re: [sqlite] Re: SQLite :memory: performance difference between v2 and v3?

2006-05-03 Thread Ivan Voras
--- Dennis Cote <[EMAIL PROTECTED]> wrote: > I made a modified version of your test program. It > uses the preferred > prepare/bind/step/finalize call family to execute > the SQL. This way it > only parses the SQL once, and executes it many > times, each time using > different parameter

Re: [sqlite] SQLite :memory: performance difference between v2 and v3?

2006-05-02 Thread Ivan Voras
> Does it only happen with a :memory: database or even > if you use a > file? When using a file the difference is much smaller, but still there: ~70 qps with sqlite3, ~90 qps with sqlite2. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the

Re: [sqlite] SQLite :memory: performance difference between v2 and v3?

2006-05-02 Thread Ivan Voras
--- Erik Jensen <[EMAIL PROTECTED]> wrote: > Does it only happen with a :memory: database or even > if you use a > file? I'll test it this evening (but I need a :memory: database for my application) > With version of the v3 lib did you use? It's 3.3.5. > I'm asking because i noticed a similar

[sqlite] Re: SQLite :memory: performance difference between v2 and v3?

2006-05-01 Thread Ivan Voras
> Testing is difficult to do correctly. As several people > noted on this list just today the first time they ran > a query it had much different > performance than subsequent > runs of the query. Did you run these tests more > than one time? What's your environment? This is not a "first time"

[sqlite] why subselect is better then join ?

2005-04-19 Thread ivan
hi I noticed that function sqlite3_step() is very slow when i want to fetch query with join(s). For example : create same table t (a int, b int, c int ... ); and insert into t large numbers of records, (about 1) time of fetching select * form t limit 0,100 is this same what select *

[sqlite] sth more then step()

2005-02-15 Thread ivan
Hi, Is there any way to skip rows in prepared statement and jump to next, sth like moveto (in sqlite3) ?? Why I have to use LIMIT in SELECT when I need use only OFFSET ? Thanks Iv

Re: [sqlite] Newbie help

2005-01-18 Thread Ivan Dimitrov
yes, it is works with LccWin32 ! you have to Add all files to Project & build! Regards I. Dimitrov From: Ulrik Petersen <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: sqlite-users@sqlite.org Subject: Re: [sqlite] Newbie help Date: Tue, 18 Jan 2005 13:02:31 +0100 MIME-Version: 1.0

[sqlite] about sqlite_freemem()

2004-04-19 Thread Ivan Dimitrov, PhD
hi, in DLL case of sqlite, do i need to call sqlite_freemem() after sqlite_exec()/sqlite_get_table(), or only after sqlite_open() , after error? Ivan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

[sqlite] cursor

2004-01-23 Thread ivan
hi is there sth like cursors ? (DECLARE CURSOR FOR SELECT ;) and FETCH,MOVE ? thanks bye ivan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[sqlite] vdbe question

2004-01-15 Thread ivan
hi how can i create vdbe for same special sql query, then check how many row a will get, and for example move to row 100 and fetch 20 rows , its could be just sql cursor but i didn't find it in sqlite .. what can i do about it ? thanks :)