Re: [sqlite] Intended use case for 'without rowid'?

2013-11-15 Thread RSmith
On Fri, Nov 15, 2013 at 7:33 AM, RSmith mailto:rsm...@rsweb.co.za>> wrote: Yes there would be a space-saving, but it is rather minimal. The real advantage is removing one complete lookup reference cycle from a Query... That was my original theory too. But experimental ev

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-15 Thread RSmith
Oh and of course the space saving for simple reference tables (basic Value-for-ref-lookups) would be great. To be sure, this does not just affect Text Keys, but all non-INTEGER primary keys, right? ___ sqlite-users mailing list sqlite-users@sqlite.

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-15 Thread RSmith
I'm ALWAYS looking for a faster query (Who isn't? -- Except those edge cases where management thinks the software is broken because the query is TOO fast and doesn't trust the results) but the loss of some common use functionality kind of has me wondering "Why?" Well yes but... Firstly, using t

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-15 Thread RSmith
Pepijn & Peter - I'm not sure how this will be an issue for the sort of existing systems you describe? You will need to actually physically change your current schemas to produce the mentioned problems, which if you don't, you have nothing to worry about. The only people I think should plan som

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-15 Thread RSmith
Here's a thought: What does your hypothetical function return for a table defined as follows: CREATE TABLE strange(rowid TEXT, _rowid_ TEXT, oid TEXT); That table has a rowid, but it is completely inaccessible to the application. Does your function return TRUE or FALSE? My point: I

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-16 Thread RSmith
Perhaps we should make the allowed DDL subset a part of the spec. That way we make explicit what is allowed and anything outside of that is forbidden. Pepijn Perhaps. It would involve a rather large document though, one which an average user is sure to skip over but at least it provides indem

Re: [sqlite] help writing DELETE with JOIN

2013-11-16 Thread RSmith
On 2013/11/16 20:02, David M. Cotter wrote: okay i realize my requirements were wrong, here's a better summary: the plID (playlist ID) in the song table is different (the OLD id 33), the plID in the playlist table is the new ID 35, so i have to test them separately. the song ID's must match t

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread RSmith
Thanks so much for the reply. Sorry for the ignorance, but wouldn't only the sectors (page cache) that are being written need to be cached? And I was trying to read up on how sqlite does atomic writes, but doesn't the way sqlite handles atomic writes guarentee that the file is *always* in a valid

Re: [sqlite] query optimization

2013-11-18 Thread RSmith
I might be missing something extraordinarily obvious... but I cannot understand the use case for this logic you have. My first response was to just use "delete from emp where key=123" and be done with it, who cares what the name is, right? But then it dawned on me that you may for some reason

Re: [sqlite] query optimization

2013-11-18 Thread RSmith
27;' ) OR ( name = ?2 )); I think this is closer to the intended - thanks, Ryan On 2013/11/18 12:56, RSmith wrote: I might be missing something extraordinarily obvious... but I cannot understand the use case for this logic you have. My first response was to just use "delete from emp w

Re: [sqlite] query optimization

2013-11-18 Thread RSmith
ot sure which but between your and my solutions both are covered though, so I hope the OP gets sorted out - if not, let us know... On 2013/11/18 13:55, Kees Nuyt wrote: On Mon, 18 Nov 2013 13:04:31 +0200, RSmith wrote: Oops, misprint... name won't be null of course, the parameter needs t

Re: [sqlite] query optimization

2013-11-18 Thread RSmith
nsert ( sOriginStr(n, "'"); } return "'" + sOriginStr + "'"; } where "'" is a single quote enclosed in double-quotes (incase that was not obvious) On 2013/11/18 14:24, d b wrote: Hi RSmith, Thanks. Still, I could not

Re: [sqlite] query optimization

2013-11-18 Thread RSmith
Thanks RSmith. It works. But, I am looking for single query for prepared statements. That's the actual struggle for me. Ok, but you give code examples that has nothing to do with prepared statements. Giving this one last push, I iwll try to ignore all you have said and simply show the

Re: [sqlite] Why must WITHOUT ROWID tables have PRIMARY KEYs?

2013-11-18 Thread RSmith
On 2013/11/19 00:45, Nico Williams wrote: Thinking about how SQLite3 would implement WITHOUT ROWID, it seems logical that a set of columns to be used as the primary indexed is required, but that they be unique shouldn't be. ..and... The implied UNIQUE constraint is just an unfortunate side-effe

Re: [sqlite] Why must WITHOUT ROWID tables have PRIMARY KEYs?

2013-11-19 Thread RSmith
On 2013/11/19 08:37, Nico Williams wrote: More generally however, it's clear that a unique constraint is not necessary to make rowid-less tables work (see the MySQL example), SQL doesn't require unique constraints, and it's not clear that just because you (or I) lack imagination that unique cons

Re: [sqlite] SQlite3 Query Format for Export

2013-11-19 Thread RSmith
What will be the query format to export database table data into different export format (CSV,HTML,XML,SQL) ? This is not an SQL function. Do you need it exported to some format once, or do you need this often (such as providing it as a standard functionality to users?) If you need it once

Re: [sqlite] Why must WITHOUT ROWID tables have PRIMARY KEYs?

2013-11-19 Thread RSmith
Hi Nico, thanks for the discussion - although this thread is dangerously close to becoming a stale debate rather than a helpful forum discussion. In this light, I will try to be brief and then fight the urge to reply again. You still seem to try and sell the usability of non-unique tables to me,

Re: [sqlite] Proper handling of SQLITE_BUSY

2013-11-20 Thread RSmith
Hi Tristan, Do you honestly have a use-case where you do not know whether a transaction is going to be writing to the DB or not? I would imagine the only way this is possible is that you are doing some form of select query, and then based on the outcome, decide whether or not to start writing

Re: [sqlite] Using multiple connections from multiple threads - SQLITE_LOCKED

2013-11-22 Thread RSmith
Hi SQLiteuser, is that really your name? - If so, bless your parents :) Seriously though, it is quite legal (and also done mostly) to have several connections to a database. What you can't do is read data WHILE another thread is writing to it in serializable mode as you are using. The table

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-24 Thread RSmith
Agreed - also some functions might not be intrinsically deterministic, but it may well be so for the duration of a query. There may need to be some thinking on this. I refer back to a discussion earlier (and subsequent SQLite adaption) which made a date-time reference deterministic within a sing

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-24 Thread RSmith
Ugh, my last thought was not well-formed - apologies. When I said: "...can add a function to replace an SQL function to improve it many times for the specific purpose". This would of course hardly matter if the SQL (or SQLite specifically) function was already deterministic (read: cached). My

Re: [sqlite] Your thoughts on these observations

2013-11-29 Thread RSmith
Hi L, You seem to be after a theory rather than an actual helpful criterion - and Richard answered questions 1, 2 and 3 all in a single statement as far as the criterion matters. To illuminate the theory is not really possible and presupposes a wealth of preceding information that must be know

Re: [sqlite] What this function returns?

2013-11-29 Thread RSmith
On 2013/11/30 05:28, Igor Korot wrote: As you can see from http://sqlite.org/c3ref/last_insert_rowid.html, it returns sqlite3_int64, a signed 64-bit integer type. The C99 name and I think the C++11 name for this is int64_t, which is probably what you want, but I vaguely recall the Microsoft com

Re: [sqlite] Percentile function in SQLite 3.8.0 (for the .NET version)

2013-11-30 Thread RSmith
Hi Hayden, The most usual form of percentile function (I believe) is where you have record values in a selection set (or "sample" from a "population" for the astute statisticians), and you wish to know if you sorted them all by value, and then grouped them in clusters of 1% so that you have a 1

Re: [sqlite] Bug in sqlite.exe? NOT !

2013-11-30 Thread RSmith
The virtualization and UAC caused many a headache for unsuspecting programmers not used to the Linux way. It's a brilliant new way they do it but they had to move from an old way to a the new way in a way that wouldn't break old Windows programs (too much). Virtualization provided just the trick

Re: [sqlite] Concrete example of corruption

2013-12-01 Thread RSmith
Hi L, This seems to be a somewhat classic case of "If your only tool is a hammer, every job resembles a nail...". Not only is Meta-data only a Mac thing, the ideal is non-reachable. What I mean is: There is an infinite number of things that will kill a system, (any system), we single out the m

Re: [sqlite] SQLite ver: 1.0.89 issue

2013-12-02 Thread RSmith
This list does not allow attachments - Could you upload them to a file-host site somewhere and paste the links kindly? Thanks, Ryan On 2013/12/02 13:56, Nikola Boyadjiev wrote: Hello, I'm very sorry, the files did not attach to the previous e-mail i sent, I will attach them to this

Re: [sqlite] Percentile function in SQLite 3.8.0 (for the .NET version)

2013-12-02 Thread RSmith
There have been a few responses to your question, I count at least 3 from different people all with working suggestions. Are you sure you are getting the list emails? Maybe check spam folders etc. Or are you unsatisfied with the responses? On 2013/12/02 19:30, Hayden Livingston wrote: Is the

Re: [sqlite] Concrete example of corruption

2013-12-05 Thread RSmith
On 2013/12/05 16:40, L. Wood wrote: Could you be clear on what issue it is that you want solved, and how your proposal solves it any better than what is currently being done ? L. Wood: We are trying to find ways to avoid the corruption problem that D. Richard Hipp outlined. See his steps (1)-(

Re: [sqlite] Selecting rows as "groups" -- "pivots"?

2013-12-05 Thread RSmith
One PIVOT-ing approach is per-item selects when you don't know the subject value - this is an exact version of your question: CREATE TABLE `temptest` ( `ID` INTEGER PRIMARY KEY, `Col1` TEXT, `Col2` TEXT, `Col3` TEXT, `Value` TEXT ); INSERT INTO `temptest` (`Col1`, `Col2`, `Col3`, `Value`) V

Re: [sqlite] Selecting rows as "groups" -- "pivots"?

2013-12-05 Thread RSmith
Apologies, my mail is slow today, did not notice this thread had progressed significantly before I posted - please ignore previous. I'm with Igor though, the multi-table layout you now have is even less convenient than the matrix - It's equally dispersed data only now you have to join 3 tables

Re: [sqlite] sqlite download for 64 bit

2013-12-09 Thread RSmith
I think the OP might mean the DLL downloaded from the site - which is W32, I don't think this can be linked into a 64-bit application... can it? (I haven't attempted it). Would the powers that be terribly mind adding a 64-bit DLL to the download list? On 2013/12/09 16:24, Kees Nuyt wrote: On

Re: [sqlite] SELECT statement failure

2013-12-09 Thread RSmith
On 2013/12/09 15:32, Simon Slavin wrote: First, never do this: CREATE TABLE IF NOT EXISTS T1(F1,F2,F3,F4,SUBTOTAL); Always define your column types. In your case you'd be using either INTEGER or REAL. Agreed, those Columns have TEXT affinity by default which is wholly unsuitable for numeri

Re: [sqlite] SELECT statement failure

2013-12-09 Thread RSmith
ase "WHERE F1 > (5 * 0.1)" assuming the F1 column has "NONE" affinity, would the calculation on the right have any automatic affinity, such as Numeric or Real, and would that inform the comparison? On 2013/12/09 19:08, Richard Hipp wrote: On Mon, Dec 9, 2013 at 11:12 AM,

Re: [sqlite] Vacuum command in a transaction?

2013-12-10 Thread RSmith
On 2013/12/11 01:41, veeresh kumar wrote: Thanks Igor and Simon for your inputs. I was under the impression that VACUUM would also help performance since it does defragmentation. Hi Veeresh, Vacuum does de-fragment the database, it also amalgamates any transaction files and so on - so you a

Re: [sqlite] REINDEX - Performance increase?

2013-12-13 Thread RSmith
We already discussed VACUUM, and REINDEX does pretty much what it says on the box. While there might be an arguably present performance increase, it should be negligible - unless you are using ascending or descending indices to which I am sure reindex will recreate the index in the proper order a

Re: [sqlite] Unexpected SELECT results

2013-12-19 Thread RSmith
The mistake is not obvious at first (took me a few takes to figure it out) and gets obscured by the use of views. I dismantled the views ruling out interplay by designing a query that should do the same sans the views, like this: SELECT _key FROM ( SELECT m.project, m.date, m.time, MIN(m._key

Re: [sqlite] Does not detect invalid column name when subexpression optimized away

2013-12-19 Thread RSmith
With this query you essentially ask the RDBMS to evaluate and supply you with the result of (X and 0) - my guess is the optimiser pounces directly on the fact that (X and 0) will always be 0 no matter what X is so that it does not bother trying to evaluate X which means it never has the need to r

Re: [sqlite] Does not detect invalid column name when subexpression optimized away

2013-12-20 Thread RSmith
On 2013/12/20 06:11, David Bicking wrote: But isn't NULL and 0 a NULL? So wouldn't it need to evaluate X to determine if it was null, and thus discover it wasn't a valid column name and return an error? David It's hard to make a case for it though. I could argue both sides from first princ

Re: [sqlite] Does not detect invalid column name when subexpression optimized away

2013-12-20 Thread RSmith
On 2013/12/20 14:09, Simon Slavin wrote: On 20 Dec 2013, at 12:05pm, Dan Kennedy wrote: "1 OR unknown" is not unknown, it is 1. And so on. To summarize: sqlite> SELECT (0 AND NULL), (1 AND NULL), (0 OR NULL), (1 OR NULL); 0|null|null|1 Well if you're so smart, (A) Anything divided by i

Re: [sqlite] GROUP BY months and years using integer data

2013-12-21 Thread RSmith
You are basically trying to group values where the individual values are different but each in itself accumulated in stead of accumulated for the grouping. Just move the scope of the grouping and use Nulls in stead of 0's, like this: SELECT stats.which_year AS year, SUM(CASE WHEN stats.which_mo

Re: [sqlite] GROUP BY months and years using integer data

2013-12-21 Thread RSmith
Boolean Logic 101 - Feel free to skip if this is not your thread! - In addition to other replies - Boolean logic is interesting in that it has no real arithmetic value and can have only true or false as a value.

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread RSmith
On 2013/12/22 09:55, Giuseppe Costanzi wrote: I don't know if I have understood well but the statment SUM(stats.quantity * (stats.which_month = 1)) SUM(stats.quantity * (stats.which_month = 2)) should be interpreted SUM stats.quantity IF stats.which_month = 1 is TRUE SUM stats.quantity IF stat

Re: [sqlite] GROUP BY months and years using integer data

2013-12-22 Thread RSmith
On 2013/12/22 20:53, James K. Lowden wrote: Similarly any attribute can be Boolean if it is found to be an attribute of an object. Giuseppe is not Boolean, but he is human and likely male, so that: (Giuseppe = Human) is true or 1, and (Giuseppe = Female) is false or 0. For RDBMS and indeed mo

Re: [sqlite] select only records with fields that BEGIN with a certain sub-string

2013-12-26 Thread RSmith
A field name is an identifier, not just a string, so mostly it can be done in a direct SQL statement since the very idea of a select is that you must at least know what you are selecting for... That said, in MySQL / PostGres (for instance) can query the schema tables where a list of all fields a

Re: [sqlite] select only records with fields that BEGIN with a certain sub-string

2013-12-26 Thread RSmith
This is actually awesome to know, thanks Stephen, I always thought at least 1 step is needed - I'm going to immediately implement this in some functions! On 2013/12/26 13:30, Stephan Beal wrote: There are probably a few approaches that would work, but I can think of none quicker/more efficien

Re: [sqlite] "Common Table Expression"

2013-12-26 Thread RSmith
This reminds me of a plan to add RADAR dishes to cars to monitor other traffic and avoid collisions - brilliant idea but the detrimental effect on aerodynamics and limiting size-factor of already-built garages all over the world stifled enthusiasm. Probably "Temporary Views" would be the exact t

Re: [sqlite] "Common Table Expression"

2013-12-27 Thread RSmith
Sorry, this struck a bit of a sore spot with me, so I apologize for the small rant... Feel free to completely ignore it. You have every right challenging the views of anyone - It is welcome even (I think - cannot speak for everyone else though, but I appreciate it). A rant however is probably

Re: [sqlite] Web application with SQLite

2013-12-27 Thread RSmith
To add to other answers: SQLite is a great DB back-end - I believe the Website at www.sqlite.org and Fossil repositories hosting the code there are all running on SQLite (if you fancy browsing an SQLite site to compare). PHP natively supports SQLite, MySQL, Postgres and MSSQL, which means the c

Re: [sqlite] "Common Table Expression"

2014-01-01 Thread RSmith
You're right : *"*CTEs ... add exactly zero to SQLite's capability." This is also right : "C Language ... add exactly zero to Intel X86 processor capability". In both case : - "adding zero capability" to the underlying tool is a physical constraint, - CTE (or C Language) bring capabilities to

Re: [sqlite] Adobe Air do not include on sqlite database

2014-01-03 Thread RSmith
If this is on Windows, the UAC might virtualize your file to a different folder so that Adobe Air actually sees a different file. Try to not store DB files inside \program-files\ or other system-folders. The actual file might be typically somewhere inside: c:\Users\your_username\roaming\your_app

Re: [sqlite] "Common Table Expression"

2014-01-04 Thread RSmith
On 2014/01/05 00:03, Petite Abeille wrote: Things change. Syntax evolves. Languages matures, even SQL. The ‘with’ clause is a change for the better. As is merge. As are windowing functions. SQLite cannot pretend it’s 1986 forever. It has to move with the times or it will become ossified, obsolet

Re: [sqlite] latest sqlite 3 with Delphi 5 professional

2014-01-22 Thread RSmith
On 2014/01/22 23:33, dean gwilliam wrote: I'm just wondering what my options are here? Any advice much appreciated. Firstly, high-five on using D5 - All the High-speed Pascal/C /Assembler coding goodness with none of the fat (as far as 32-bit goes anyway) - I use it all the time for critical/s

Re: [sqlite] too many SQL variables

2014-01-30 Thread RSmith
Just for my edification, what is the limit on the number of SQL parameters? Today I hit "too may SQL variables" with about 1400… Just for our edification, which kind of statement was that? The worst kind :) ___ sqlite-users mailing list sqlite-

[sqlite] Database Grammar 101

2014-02-01 Thread RSmith
I know this is a Database forum (as opposed to a language forum) but kindly allow me a quick interjection here since I have met this question many times, as posed by Scott in a forum question: On 2014/02/01 06:01, Scott Robison wrote: Exerpt: ...// *and* information that led to creation of ideal

Re: [sqlite] Database Grammar 101

2014-02-01 Thread RSmith
rddictionaries.com/definition/english/index http://www.worldwidewords.org/qa/qa-ind2.htm On 2014/02/01 13:43, Richard Hipp wrote: On Sat, Feb 1, 2014 at 5:59 AM, RSmith mailto:rsm...@rsweb.co.za>> wrote: I know this is a Database forum (as opposed to a language forum) but kindly

Re: [sqlite] Free Page Data usage

2014-02-07 Thread RSmith
A database that is geared for 32TB size and you are concerned about rather insignificant space wasted by the page size that is needed to reach the 32TB max size... does not make any sense unless you are simply paranoid about space. Removing the gaps in the table space when deleting a row (or row

Re: [sqlite] Free Page Data usage

2014-02-08 Thread RSmith
Hi Raheel, It does make sense what you would like to do, but your concern does not make sense. You say you are "trying to optimize the utilization of the free space available" but give no indication why, it certainly does not seem that space is a problem. I do understand the urge to optimize v

Re: [sqlite] struggling with a query

2014-02-08 Thread RSmith
One way of doing it: SELECT IFNULL(V1.name,V2.name) AS VName, CASE WHEN V1.name=V2.name THEN 0 ELSE -1 END AS VInd FROM v AS V1 LEFT JOIN v AS V2 ON (V1.vid<>V2.vid) AND (V1.name=V2.name) WHERE V1.vid=1 UNION SELECT IFNULL(V1.name,V2.name) AS VName, CASE WHEN V1.name=V2.name THEN 0 ELSE 1 EN

Re: [sqlite] struggling with a query

2014-02-08 Thread RSmith
Yeah I quite like some of the solutions posted - got to love this list :) One final optimization, since those values you are looking for essentially maps to Boolean (0 and 1), this query is the smallest and probably fastest (I think) that will produce the correct results from your table: SELEC

Re: [sqlite] struggling with a query

2014-02-08 Thread RSmith
Just to be clear, it isn't really "mine", just an adaption of the many excellent contributions, from which I too have learned. A huge pleasure and fun exercise no less! On 2014/02/08 14:35, Stephan Beal wrote: On Sat, Feb 8, 2014 at 12:39 PM, RSmith wrote: SELECT name, max(v

Re: [sqlite] Free Page Data usage

2014-02-08 Thread RSmith
On 2014/02/08 19:30, Raheel Gupta wrote: @Simon, Sir I dont want to rearrange the data. I will try to explain more. All my rows have the exact same size. They will not differ in size. My problem is due to the fact that I use 64kB page size. My rows are exactly 8 Bytes + 4096 Bytes. Now for the

Re: [sqlite] Free Page Data usage

2014-02-09 Thread RSmith
On 2014/02/09 12:06, Raheel Gupta wrote: Hi, Sir, I have only one auto increment primary key. Since the new rows will always have a higher number will the pages which have some free space by deleting rows with lower numbered keys never be reused ? e.g. If row with ROWID "1" was deleted and free

Re: [sqlite] LIKE operator and collations

2014-02-09 Thread RSmith
On 2014/02/09 13:18, Constantine Yannakopoulos wrote: Hello all, I have a case where the user needs to perform a search in a text column of a table with many rows. Typically the user enters the first n matching characters as a search string and the application issues a SELECT statement that use

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-10 Thread RSmith
On 2014/02/10 18:22, John McKown wrote: Being a UNIX (Linux) partisan, and somewhat tacky towards Windows users, why not go the normal Windows route of having a "pop up" dialog box (or at least a message) similar to what normal Windows applications say about possible loss of data. Something alon

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-10 Thread RSmith
On 2014/02/10 20:31, Petite Abeille wrote: On Feb 10, 2014, at 4:23 PM, Richard Hipp wrote: Proposed Change To Address The Problem: What’s the problem exactly? CS101 students distress? That’s way beyond SQLite reach. My 2¢: don’t create a default persistent database. This is not helpful to

Re: [sqlite] help needed for major SQLite problem

2014-02-10 Thread RSmith
On 2014/02/10 21:18, C M wrote: Documents\My Dropbox\myapp\gorp.db-journal) - Access is denied. (3338) SQLITE_IOERR SQLITE_LOG: statement aborts at 16: [SELECT resumes, start FROM WHERE start='2014-02-07 14:24:14.064000' AND value='activity'] disk I/O error (3338) SQLITE_IOERR Looks like GetFi

Re: [sqlite] help needed for major SQLite problem

2014-02-10 Thread RSmith
On 2014/02/10 23:20, C M wrote: On Mon, Feb 10, 2014 at 2:54 PM, RSmith wrote: How to go from the error codes to the diagnosis? I think the logic is as follows: [lots of snipping] Thanks for this insight. I purposefully put the SQlite database file in the Dropbox folder because it was

Re: [sqlite] help needed for major SQLite problem

2014-02-10 Thread RSmith
On 2014/02/10 23:40, Stephen Chrzanowski wrote: Personally, I don't buy that DropBox is the culprit as I've done this kind of thing a few times in a few applications of my own, however, I'm the single user that works on that single account, and any app that uses DB is usually under development a

Re: [sqlite] on insert new row, increment date with a month

2014-02-11 Thread RSmith
On 2014/02/11 20:07, Gert Van Assche wrote: All, Does anyone know if it is possible for a date field to be automatically incremented with a month when a new record is created? If the last row contains "2013-01-01" in the DateField then the DateField of the new row should automaticllay be "2013

Re: [sqlite] How to minimize fsync'ed writes to flash for storing periodically measured data?

2014-02-12 Thread RSmith
On 2014/02/12 10:09, Stephen Chrzanowski wrote: The other thing I'd look into is that because of the varying speeds of SD, the volume of information you could be writing, you may run into an issue where you call the backup API but due to write speeds, something else writes to the live in-memory

Re: [sqlite] HTML Tokenizer

2014-02-13 Thread RSmith
On 2014/02/13 22:35, Petite Abeille wrote: While we are at it, www.sqlite.org exhibits many validation errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.sqlite.org%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2

Re: [sqlite] Once again about random values appearance

2014-02-17 Thread RSmith
On 2014/02/17 09:59, Max Vlasov wrote: Ok, I hope I found the topic, the title was "racing with date('now') (was: Select with dates): one of the links to the archive https://www.mail-archive.com/sqlite-users@sqlite.org/msg79456.html CMIIW, but as I see it, the final modification was comm

Re: [sqlite] Question regarding guarantees of SQLITE_DETERMINISTIC

2014-02-17 Thread RSmith
On 2014/02/17 18:47, Stephan Beal wrote: Hi, all, Regarding SQLITE_DETERMINISTIC: http://www.sqlite.org/c3ref/create_function.html does specifying that flag guaranty that sqlite3 will only call my "deterministic" function one time during any given SQL statement, or must my function actually g

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread RSmith
On 2014/02/17 19:01, Stephan Beal wrote: On Mon, Feb 17, 2014 at 5:57 PM, Tim Streater wrote: complete in a browser window, which data is then gathered up and sent using ajax to be processed by a PHP script, which writes it to an sqlite db. The user complains that some of this data doesn't ma

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread RSmith
Forgot to add: My headache was essentially UTF-8 encoding, but the same would happen with others, though invalid chars do not really exist in UTF7 or ANSI, but in the higher level encodings they are plentiful. On 2014/02/17 19:35, RSmith wrote: Yeah, I too have had real problems with this

Re: [sqlite] calculation of a fraction stored in a text column

2014-02-20 Thread RSmith
Ensure you store the string representation of the reals (floats w/e) of precise numerical format and length, such that: 0.3, 12 and 1.456 all look alike and sorts correct ex: "000.30" and "001.456000" and "012.00" etc. or whatever similar format you may choose as Simon (I think) s

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-21 Thread RSmith
On 2014/02/21 11:54, _ph_ wrote: Suggestion: Warning banner, and a .saveas command that copies the db to a file. (I haven't read the entire thread, sorry if this already came up.) There is usually no call to read an entire thread, unless you decide to actually post an opinion, in which case

Re: [sqlite] Problem with .mode line

2014-02-21 Thread RSmith
On 2014/02/20 16:58, pelek wrote: indeed ! I tried to open same file with Programers Notepad and file looked exacly like I need. But when I was opening file in standard windows notepad then I got whole CREATE TABLE code in one line! It is problem for me, because I am trying to open same file wit

Re: [sqlite] partially excluding records

2014-02-21 Thread RSmith
On 2014/02/21 20:23, David Bicking wrote: I have a table like SELECT * FROM T1; Key Status 1 O 1 O 2 O 2 C 3 C 3 C 4 O 4 P Now, I need to consolidate that data. SELECT Key, COUNT(STATUS) Cnt , MIN(STATUS) || CASE WHEN COUNT(STATUS)>1 THEN '+' ELSE ''

Re: [sqlite] Delete From Not Working Properly

2014-02-21 Thread RSmith
On 2014/02/22 00:32, Geo Wil wrote: 1. Windows 7 Ultimate 64-bit 2. Here is the path I am using: void Database::openSave(bool* bErrors) { if (sqlite3_open("*scSave.sqlite*",&dBase) != SQLITE_OK) { *bErrors = true; createBInfo(); d.createBReport("SQL Code 1",

Re: [sqlite] Delete From Not Working Properly

2014-02-21 Thread RSmith
On 2014/02/22 01:37, Geo Wil wrote: As for the fail path issue, it is not an issue or at least it has never been for me. The way I understand it is that if you just put the file name into a function requesting a path in Windows it will look in the folder the process is running from for that

Re: [sqlite] How to Troubleshoot Disk I/O Error

2014-02-26 Thread RSmith
On 2014/02/26 16:27, Richard Hipp wrote: LOG: os_win.c:33842: (33) winTruncate2(D:\blp\wintrv\smartclient\applications\appinfo.db-shm) - プロセス㠯ファイル㠫アクセス㠧ã 㠾㠛ん。別㠮プロセス㠌ファイル㠮一部をロムE‚¯ã —ã, extended-result-code: 1546 TRUNCATE fil

Re: [sqlite] New

2014-02-28 Thread RSmith
On 2014/02/28 17:13, Ashleigh wrote: Nothing will load in SQLite just the command box Not sure if this is a prophecy, a problem, a proposition or a premonition, but I am pretty confident that it isn't an SQLite process problem. Might you give us some more information please? What command bo

Re: [sqlite] Why SQLITE_FLOAT instead of SQLITE_REAL?

2014-03-01 Thread RSmith
On 2014/02/28 23:36, L. Wood wrote: SQLite has the REAL data type: https://www.sqlite.org/datatype3.html Then why do we have SQLITE_FLOAT instead of SQLITE_REAL? All the other data types (INTEGER, BLOB, TEXT, NULL) match with the SQLITE_ constants. Quoting Shakespeare's Juliet: "What's in a

Re: [sqlite] Why SQLITE_FLOAT instead of SQLITE_REAL?

2014-03-01 Thread RSmith
On 2014/03/01 10:32, Darren Duncan wrote: If you're going by semantics though, the meanings are quite different. A real number represents a point on a line and can be either a rational or irrational number. (And a complex number is a point on a plane.) An important bit is that a real is a m

Re: [sqlite] "INSERT" and "END TRANSACTION" time

2014-03-03 Thread RSmith
On 2014/03/03 23:11, romtek wrote: Simon, does a real disk have to be a rotating hard disk? Is there problem with SSDs as far as SQLite is concerned? No, what Simon is trying to point out is simply that the write performance experienced by L. Wood might be because journal writes might be syn

Re: [sqlite] Virtual table API performance

2014-03-05 Thread RSmith
On 2014/03/05 10:41, Dominique Devienne wrote: On Tue, Mar 4, 2014 at 9:41 PM, Elefterios Stamatogiannakis One thing that IMHO long term might improve the situation would be if SQLite's own "native" tables would use the same Virtual Table API,//... ...//Of course, the above is a "naive" abstra

Re: [sqlite] Weird out of memory problem a prepare

2014-03-05 Thread RSmith
On 2014/03/04 22:05, Eduardo Morras wrote: The tables have 4 rows each one, that's why I got suprised with the Out of Memory error. The biggest row has 12KB and with the join I do, shouldn't use more than 200KB. Changing the ',' with the join you propose, gives Out of Memory too. It happens

Re: [sqlite] How to write a query

2014-03-05 Thread RSmith
On 2014/03/05 12:04, Igor Korot wrote: Hi, ALL, Let's say I have a table with following data: field1field2field3 field4 12 3 4 5 6 7 8 How do I write a query which will produce the output as: 1 2 5 6 3 4 7 8 Is it possible to

Re: [sqlite] How to write a query

2014-03-05 Thread RSmith
On 2014/03/05 12:24, Igor Korot wrote: With UNION I will have 2 DB hits, correct? Meaning I execute the part on the left side of the UNION and then execute the right side of the UNION and then add the results together. Do I understand correctly? Thank you. Yes. Obviously you need to have the

Re: [sqlite] select where field in ($tcl_list) ?

2014-03-05 Thread RSmith
On 2014/03/05 17:05, Chris wrote: Ok, fair enough. I thought that in the same way that sqlite looks for binary vs. string representations of referenced vars and has alternative ways of specifying variable to bind to ('@', ':'), it might also spot a list object and internally expand it to "elem_

Re: [sqlite] Instead Of Insert Trigger Error

2014-03-06 Thread RSmith
On 2014/03/06 18:41, Tilsley, Jerry M. wrote: I would like to create the following INSTEAD OF INSERT trigger: create trigger insteadInsertPanelTracker instead of insert on panel_tracker begin set @ov_id = select ov_id from ov_systems where mt_mnemonic=NEW.ov_id; insert into panel_tracker values

Re: [sqlite] RPAD/LPAD

2014-03-06 Thread RSmith
On 2014/03/07 01:59, Gabor Grothendieck wrote: A small enhancement request: It would be great if the RPAD and LPAD functions could be implemented in sqlite. The SQLite you can get the effect of RPAD(x,y) using PRINTF('%-*s',y,x). See http://www.sqlite.org/lang_corefunc.html#printf for d

[sqlite] 64bit DLL

2014-03-10 Thread RSmith
Have any of you kind folks a recent 3.8.3 (or newer) 64-bit DLL for SQLite3 perhaps? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Fwd: Exception when querying a range index

2014-03-11 Thread RSmith
On 2014/03/11 11:58, St. B. wrote: I still have a question. Since I have many threads (between 100 and 200) that do reading on the table that has the R Tree, and 1 thread that will write to another table once every five minutes, is it normal that I get database is locked error on a regular basis

Re: [sqlite] basic "Window function"

2014-03-13 Thread RSmith
On 2014/03/13 20:02, Petite Abeille wrote: On Mar 13, 2014, at 4:17 PM, big stone wrote: Is there anyone else, (besides little bee), that would "like" this request? "Oh! Oh pick me! Pick me! Me! Me! M!” — Donkey, Shrek Hehe, I live in a Country with 11 official languages. Needless to s

[sqlite] Execute Error Notification

2014-03-16 Thread RSmith
I use quite a few script-type sql lists to achieve some functions in some systems, by which I basically mean I make up a list of SQL statements and then just send them to the very convenient sqlite3_exec() function when I'm pretty sure I cannot do it any faster by individual steps or speed is n

Re: [sqlite] Error "Database or disk if full" shown when indexing for 2 billion records.

2014-03-17 Thread RSmith
That's insane... well done :) To create the Index you will need at least as much disk space as already used... so you will need another 87GB (approx), not just another 50GB. And it will take no longer to create the table + Index from the start than it will take to create first the table, then

Re: [sqlite] Error "Database or disk if full" shown when indexing for 2 billion records.

2014-03-17 Thread RSmith
is not much difference between using TEXT or VARCHAR(32) in SQLite, but it matters elsewhere and I believe even SQLite will use that varchar value in the query optimiser... [citation needed] On 2014/03/17 15:39, RSmith wrote: That's insane... well done :) To create the Index you will ne

  1   2   3   4   >