Re: [sqlite] Unable to store 500MB size of row data even after define macro SQLITE_MAX_LENGTH

2017-12-08 Thread Dianne Dunn
How,do I get off this email list?? What is it for?? Sent from my iPad > On Dec 8, 2017, at 7:30 AM, Kees Nuyt wrote: > > On Thu, 7 Dec 2017 23:59:02 -0700 (MST), Durgesh > wrote: > >> getting error "QSqlError("18", "Unable to bind parameters",

Re: [sqlite] random value get re-generated too often in SQLite

2017-12-08 Thread Scott Doctor
Is it possible that the first call to random is cached and the cached value is being returned in subsequent calls? - Scott Doctor sc...@scottdoctor.com - On 12/8/2017 12:09, John McKown wrote: On Fri, Dec 8, 2017 at 12:54 PM, John Mount

Re: [sqlite] random value get re-generated too often in SQLite

2017-12-08 Thread John McKown
On Fri, Dec 8, 2017 at 12:54 PM, John Mount wrote: > I am seeing an issue where a random value in a sub-query gets re-generated > each time the value is used in later queries. Below is an example query: > > SELECT r AS r1, r AS r2 FROM ( SELECT random() AS r FROM ( SELECT

[sqlite] random value get re-generated too often in SQLite

2017-12-08 Thread John Mount
I am seeing an issue where a random value in a sub-query gets re-generated each time the value is used in later queries. Below is an example query: SELECT r AS r1, r AS r2 FROM ( SELECT random() AS r FROM ( SELECT * from ( VALUES(1),(2) ) ) a ) b One would expect r1 == r2. ---

Re: [sqlite] Virtual table row deletition on trigger

2017-12-08 Thread Tibor Balog
All right, I think I was missing a potentialy important info. I am deleting rows as ranges. It is up to SQLite how to do the deletation. I am pushing ranges in a loop in the transaction. Than the loop breaks signaling "busy" or "overwhelmed" state. Without the transaction frame it is

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Tibor Balog
Well, coming from a strongly typed education this is too much freedom for me. - Just kidding - Thanks for the vital info, appreciated. -Ursprüngliche Nachricht- From: Keith Medcalf Sent: Friday, December 8, 2017 7:14 PM To: SQLite mailing list Subject: Re: [sqlite] DateTime to

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Keith Medcalf
That is: UPDATE Table SET Datum = (StrfTime('%s', Datum) + 62135596800) * 1000 WHERE typeof(Datum) == 'text'; There is no such thing as a datatype of "bigint". This declaration will give you a column affinity of "integer". There is no such thing as a datatype of "DateTime". This

[sqlite] Virtual table row deletition on trigger

2017-12-08 Thread Tibor Balog
Hello, I run into a little anoyance regarding virtual table. I have a contentless table: CREATE VIRTUAL TABLE "OCR" using fts5 (content='',FullText) bind with a trigger for row deletition: CREATE TRIGGER "ART_AD" AFTER DELETE ON "ART" BEGIN INSERT INTO "OCR" ("OCR",rowid)

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Tibor Balog
Bow! that's what I call 'service' ! I was looking for a good day for this and nothing habe poped up only for the reverse task. You made my day! Thank You Sir. -Ursprüngliche Nachricht- From: Paul Sanderson Sent: Friday, December 8, 2017 6:16 PM To: SQLite mailing list Subject:

Re: [sqlite] DateTime to bigint

2017-12-08 Thread Paul Sanderson
Hi Tibor Your date format is windows ticks, i.e. 100 nano seconds intervals since 01/01/0001 You can convert it as follows SELECT (StrfTime('%s', '2004-08-05') + 62135596800) * 1000 AS Ticks where StrfTime('%s', '2004-08-05') is the number of seconds between the provided date and 1/1/1970

[sqlite] DateTime to bigint

2017-12-08 Thread Tibor Balog
Hi there, I am very new to SQLite but like it sofar. Run into something couldn’t find an answer may someone can put me in the right direction.. Have an application uses SQLite table with a column “Datum” defined as bigint. I have an identical table with column “Datum” as DateTime “-mm-dd”

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Luuk
You are correct, but i'm not using sqlite enough to know (or remember) it also has a sqlite_master :-):-) On 08-12-17 16:48, Donald Griggs wrote: For windows, I think the following would work: sqlite3 %DB% -batch "SELECT TBL_NAME FROM sqlite_master WHERE type=='table' order by tbl_name;"

Re: [sqlite] Why Unicode is difficult

2017-12-08 Thread John G
Fascinating article. Thanks. John Gillespie On 4 December 2017 at 13:08, Simon Slavin wrote: > Every so often someone asks on this list for Unicode to be handled > properly. I did it myself. Then other people have to explain how hard > this is. So here’s an article

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Donald Griggs
For windows, I think the following would work: sqlite3 %DB% -batch "SELECT TBL_NAME FROM sqlite_master WHERE type=='table' order by tbl_name;" >%temp%\dump.tmp for /f "usebackq" %%i in (`type %temp%\dump.tmp`) do sqlite3 %DB% -batch ".mode tabs" -batch "SELECT * FROM %%i "

Re: [sqlite] Unable to store 500MB size of row data even after define macro SQLITE_MAX_LENGTH

2017-12-08 Thread Kees Nuyt
On Thu, 7 Dec 2017 23:59:02 -0700 (MST), Durgesh wrote: > getting error "QSqlError("18", "Unable to bind parameters", "string or blob > too big")" while inserting a row data of size 500MB. > > However insertion of 450 MB is successful. > > Tried define the macro

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Luuk
On 08-12-17 14:52, Luuk wrote: On 08-12-17 14:13, Simon Slavin wrote: On 8 Dec 2017, at 7:02am, Peng Yu wrote: I'd like to dump all the tables to separate files, one table one file. Each file should be in TSV format. Is there a convenient way to do so in sqlite3?

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Simon Slavin
On 8 Dec 2017, at 1:58pm, Peng Yu wrote: > Could you provide the working code for bash (on Mac OS X or linux)? Thanks. Something like this … sqlite3 myDatabase.sqlite > myTable.tsv << EOS .mode tabs select * from myTable; EOS The first EOS must be at the very

Re: [sqlite] Timing issue with min, max and count

2017-12-08 Thread x
>But these special optimizations only apply when min(), max(), and count(*) are used in isolation. Hence, they do not work for the first query above that uses all three functions at one. Thanks Richard. >(1) If you are using INTEGER PRIMARY KEY, you should *not* be using a WITHOUT ROWID. You

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Peng Yu
Could you provide the working code for bash (on Mac OS X or linux)? Thanks. On Fri, Dec 8, 2017 at 7:52 AM, Luuk wrote: > On 08-12-17 14:13, Simon Slavin wrote: >> >> >> On 8 Dec 2017, at 7:02am, Peng Yu wrote: >> >>> I'd like to dump all the tables to

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Luuk
On 08-12-17 14:13, Simon Slavin wrote: On 8 Dec 2017, at 7:02am, Peng Yu wrote: I'd like to dump all the tables to separate files, one table one file. Each file should be in TSV format. Is there a convenient way to do so in sqlite3? There’s no direct output from the

Re: [sqlite] Timing issue with min, max and count

2017-12-08 Thread Simon Slavin
On 8 Dec 2017, at 1:17pm, Simon Slavin wrote: > helps you (and us, if you want to post it) to understand what’s happening. Please ignore my post. Dr H explain your situation exactly. Simon. ___ sqlite-users mailing list

[sqlite] Possible bug when compiling with SQLITE_OMIT_TRIGGER option

2017-12-08 Thread M Irya
Hello, I'm trying to create a minimal SQLite3 library build and seems like the foreign keys logic is not properly run on DELETE when building the sources with -DSQLITE_OMIT_TRIGGER=1. Here's the patch against amalgamation v3.21.0 sqlite.c: --- sqlite3.c.orig 2017-12-08 14:06:04.814913000 +0100

Re: [sqlite] Timing issue with min, max and count

2017-12-08 Thread Simon Slavin
On 8 Dec 2017, at 12:20pm, x wrote: > I have a table with 2.4 million records. It’s a without rowid table (I don’t > know if that’s significant) with an integer primary key (ID) and several > secondary indexes of the form (OtherCol, ID). If I run > > select min(ID),

Re: [sqlite] Timing issue with min, max and count

2017-12-08 Thread Richard Hipp
On 12/8/17, x wrote: > > I have a table with 2.4 million records. It’s a without rowid table (I don’t > know if that’s significant) with an integer primary key (ID) and several > secondary indexes of the form (OtherCol, ID). If I run (1) If you are using INTEGER PRIMARY

Re: [sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Simon Slavin
On 8 Dec 2017, at 7:02am, Peng Yu wrote: > I'd like to dump all the tables to separate files, one table one file. > Each file should be in TSV format. > > Is there a convenient way to do so in sqlite3? There’s no direct output from the SQLite library to produce TSV

[sqlite] Timing issue with min, max and count

2017-12-08 Thread x
I have a table with 2.4 million records. It’s a without rowid table (I don’t know if that’s significant) with an integer primary key (ID) and several secondary indexes of the form (OtherCol, ID). If I run select min(ID), max(ID), count(*) from BigTbl; It takes 0.67 secs If I run the three

Re: [sqlite] getting error "string or blob too big" for 500 MB data insertion

2017-12-08 Thread Richard Hipp
On 12/8/17, Durgesh wrote: > I am trying to insert 500 MB of row data using Qt SQL into sqlite db. How are you measuring the row size? > > Insertion is successful up to 450 MB. > > defined macro SQLITE_MAX_LENGTH to larger value than 500 MB, as mentioned in >

[sqlite] getting error "string or blob too big" for 500 MB data insertion

2017-12-08 Thread Durgesh
I am trying to insert 500 MB of row data using Qt SQL into sqlite db. Insertion is successful up to 450 MB. defined macro SQLITE_MAX_LENGTH to larger value than 500 MB, as mentioned in http://www.sqlite.org/limits.html Still getting above error while insertion. -- Sent from:

[sqlite] How to dump all the tables into separate files?

2017-12-08 Thread Peng Yu
I'd like to dump all the tables to separate files, one table one file. Each file should be in TSV format. Is there a convenient way to do so in sqlite3? -- Regards, Peng ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] Unable to store 500MB size of row data even after define macro SQLITE_MAX_LENGTH

2017-12-08 Thread Durgesh
getting error "QSqlError("18", "Unable to bind parameters", "string or blob too big")" while inserting a row data of size 500MB. However insertion of 450 MB is successful. Tried define the macro SQLITE_MAX_LENGTH with value of SQLITE_MAX_LENGTH=20 , larger than 500MB. pls suggest a way