[sqlite] Counting changes in a INSERT/REPLACE

2014-07-29 Thread jose isaias cabrera
Greetings! I have this update: BEGIN; INSERT OR REPLACE INTO A SELECT * FROM client.A WHERE id = 1 AND Date != '2014-06-22'; INSERT OR REPLACE INTO A SELECT * FROM client.A WHERE id = 2 AND Date != '2014-06-22'; ... ... INSERT OR REPLACE INTO A SELECT * FROM c

Re: [sqlite] ISO time leap second.

2014-07-28 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 7/28/2014 12:37 PM, jose isaias cabrera wrote: I claim that I am not an expert, but is this one a valid ISO time stamp? If so, then that ISO must be revised, as that time does not really exists ever. That time does really exist, occasiona

Re: [sqlite] Slow response using WHERE - IN

2014-07-28 Thread jose isaias cabrera
Clemens Ladisch wrote... The first command is slow because the subquery generates lots of results, but because of the reference to A.Date, it is a correlated subquery and must be re-executed for each row in A. If a have understood the query correctly, you want to check whether a corresponding ro

Re: [sqlite] ISO time leap second.

2014-07-28 Thread jose isaias cabrera
"Igor Tandetnik" wote... On 7/28/2014 11:49 AM, Jan Nijtmans wrote: 2014-07-28 17:10 GMT+02:00 Igor Tandetnik : All your fix does is have the parser accept "60" as valid seconds field. That's not very interesting. julianday('2012-06-30T23:59:60'), and how should it compare with I claim t

Re: [sqlite] Slow response using WHERE - IN

2014-07-27 Thread jose isaias cabrera
Clemens Ladisch wrote... On 07/26/2014 06:22 AM, jose isaias cabrera wrote: INSERT OR REPLACE INTO LSOpenProjects SELECT * FROM client.LSOpenProjects WHERE id = 1 AND Date != A.Date; What is A? Sorry, this should have been written like this. INSERT OR REPLACE INTO

[sqlite] Slow response using WHERE - IN

2014-07-25 Thread jose isaias cabrera
Greetings. I have a slow response problem... This command, used in conjunction with an another much bigger attached DB (client), BEGIN; INSERT OR REPLACE INTO LSOpenProjects SELECT * FROM client.LSOpenProjects as A WHERE id IN ( SELECT id from LSOpenProjects WHE

Re: [sqlite] Addressing columns in an attached db

2014-07-23 Thread jose isaias cabrera
"James K. Lowden" wrote... On Wed, 23 Jul 2014 20:00:52 -0600 "Keith Medcalf" wrote: BEGIN; INSERT OR REPLACE INTO LSOpenProjects SELECT * FROM client.LSOpenProjects as A WHERE A.ProjID <= 133560 AND Date != A.Date AND A.login = 'user1'; END; I presume th

Re: [sqlite] Addressing columns in an attached db

2014-07-23 Thread jose isaias cabrera
"Keith Medcalf" wrote... BEGIN; INSERT OR REPLACE INTO LSOpenProjects SELECT * FROM client.LSOpenProjects as A WHERE A.ProjID <= 133560 AND Date != A.Date AND A.login = 'user1'; END; I presume that LSOpenProjects in both databases has a unique constraint on Proj

Re: [sqlite] Addressing columns in an attached db

2014-07-23 Thread jose isaias cabrera
Richard Hipp wrote... On Wed, Jul 23, 2014 at 12:32 PM, jose isaias cabrera wrote: Greetings. I have two DB identical and I am copying data from one to another. When I attach a DB, i.e.. ATTACH 'c:\db\mydb.sqlite' as client; how do I address the names of the column? for exa

[sqlite] Addressing columns in an attached db

2014-07-23 Thread jose isaias cabrera
Greetings. I have two DB identical and I am copying data from one to another. When I attach a DB, i.e.. ATTACH 'c:\db\mydb.sqlite' as client; how do I address the names of the column? for example, both DBs connected and disconnected have the columns: id,ProjID, Date, code, login. When I do

Re: [sqlite] Setting boundaries in a search

2014-07-16 Thread jose isaias cabrera
"Simon Slavin" wrote... On 16 Jul 2014, at 1:23pm, jose isaias cabrera wrote: "Simon Slavin" wrote... CREATE INDEX sci ON startcodes (code,id) You will find that that SELECT will then be blisteringly fast even with millions of rows in your table. I do have that I

Re: [sqlite] Setting boundaries in a search

2014-07-16 Thread jose isaias cabrera
"RSmith" wrote... On 2014/07/16 14:23, jose isaias cabrera wrote: "Simon Slavin" wrote... That way is not particularly slow. You just need to have a good index. A good index for that search would be CREATE INDEX sci ON startcodes (code,id) You will find that that

Re: [sqlite] Setting boundaries in a search

2014-07-16 Thread jose isaias cabrera
"Rob Willett" wrote... Hi, Can I add my very first piece of advice after listening and reading for the last 6-9 months :) I’ll second what Simon says, I use the very same technique for a table with 4M+ records in and its so fast I thought I had an error and looked for bugs in my code. I a

Re: [sqlite] Setting boundaries in a search

2014-07-16 Thread jose isaias cabrera
"Simon Slavin" wrote... On 16 Jul 2014, at 3:21am, jose isaias cabrera wrote: SELECT * from startcodes where code = 'e'; but I want to search only from id >= 8 and <= 14. Is there a way to set the boundary for that SELECT that will only search ids 8-14? I

Re: [sqlite] Setting boundaries in a search

2014-07-16 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 7/15/2014 10:21 PM, jose isaias cabrera wrote: SELECT * from startcodes where code = 'e'; but I want to search only from id >= 8 and <= 14. Just say so: SELECT * from startcodes where code = 'e' and id between 8 and 14;

[sqlite] Setting boundaries in a search

2014-07-15 Thread jose isaias cabrera
Greetings. Pardon the newbie question, but is there a way to set boundaries on a search? Imagine this scenario: startcodes id,code,date 1,a,2014-08-06 2,b,2014-08-06 3,z,2014-08-06 4,g,2014-08-06 5,g,2014-08-06 6,j,2014-08-06 7,p,2014-08-06 8,t,2014-08-06 9,e,2014-08-06 10,w,2014-08-06 11,w,2

Re: [sqlite] SQLite Database Browser v3.2 released

2014-07-08 Thread jose isaias cabrera
justin wrote... A quick FYI. SQLite Database Browser v3.2 has been released. This version has a OSX .dmg binary for download as well as the Windows .exe + Linux/BSD/etc compatible source. https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/sqlb-3.2.0 Hope that's useful for peopl

Re: [sqlite] Updating one DB from another

2014-06-19 Thread jose isaias cabrera
Simon Slavin wrote... On 19 Jun 2014, at 3:55pm, jose isaias cabrera wrote: These servers will be in two different servers and in two different parts of the world, so network access will be very slow. What I am thinking in doing is to copy the data on Server1 to Server2 and set the

[sqlite] Updating one DB from another

2014-06-19 Thread jose isaias cabrera
Greetings and salutations. We are in a tough situation, where we are going to have two instances of our application running on two different server: Server1: The original server, will continue to handle projects that are already opened until they are all closed and will not be able to open new

Re: [sqlite] Suggestion for SHELL impovement (built-in scripting)

2014-06-18 Thread jose isaias cabrera
to...@acm.org wrote... Hi all, ... So here’s my suggestion for what (I feel) is a significant improvement for the SHELL version of SQLite without being too much of a programming complication in my view. (Those who usually attack any new concept, please pause a moment and give it some thoug

Re: [sqlite] Understanding Sqlite

2014-06-16 Thread jose isaias cabrera
"dd" wrote... Dear Author/All, There are many things needs to understand from sqlite apart from RDBMS concepts. For example, pragmas, database connection in different scenarios, IPC, virtual tables..etc. Do sqlite team has any plan to start online university for training and issuing

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 5/30/2014 4:43 PM, jose isaias cabrera wrote: But I want, 1|d|270|190|80 2|f|298|248|50 3|i|140|115|25 or 1|d|270|190|80 2|g|298|248|50 3|i|140|115|25 Does it matter from which row (among those with Xtra4='y') vEmail comes? You were t

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread jose isaias cabrera
"Luuk" wrote... On 30-5-2014 19:29, jose isaias cabrera wrote: "Igor Tandetnik" wrote... On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtra4='y' What do you mean by "first r

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 5/30/2014 1:29 PM, jose isaias cabrera wrote: "Igor Tandetnik" wrote... On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtra4='y' What do you mean

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 5/30/2014 1:29 PM, jose isaias cabrera wrote: Good point. I was, wrongly, thinking that it was top to bottom with the id. So, the idea is that once Xtra4='y' has provided a value, that is what I want. So, I think that because I am always ge

Re: [sqlite] Help with SELECTing CASE problem

2014-05-30 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 5/30/2014 12:41 PM, jose isaias cabrera wrote: What should be returned is the value of vEmail of the first record that has Xtra4='y' What do you mean by "first record"? Records are processed in no particular order. Good point. I

[sqlite] Help with SELECTing CASE problem

2014-05-30 Thread jose isaias cabrera
Greetings! I have this SELECT, SELECT cust, ProjID, proj, A_No, bdate, CASE Xtra4 WHEN 'y' THEN vEmail ELSE 'noemail' END, sum(ProjFund), sum(ProjFund)-sum(CASE Xtra4 WHEN 'y' THEN invoice ELSE 0 END), sum(CASE Xtra4 WHEN 'y' THEN invoice ELSE 0 E

Re: [sqlite] SELECTing WHERE calculation > 0

2014-05-30 Thread jose isaias cabrera
"Edward Lau" wrote... Hi Jose: In SQL, aggregate function cannot be used in the WHERE clause. Use the HAVING clause instead. Try this: SELECT cust, ProjID, proj, A_No, bdate, CASE Xtra4 WHEN 'y' THEN vEmail ELSE 'noemail' END, sum(ProjFund), sum(

Re: [sqlite] SELECTing WHERE calculation > 0

2014-05-30 Thread jose isaias cabrera
; AND '2014-05-15') GROUP BY cust, ProjID, proj, A_No HAVING sum(case Xtra4 when 'y' then invoice else 0 end) > 0; On Thu, May 29, 2014 at 5:14 PM, jose isaias cabrera wrote: Greetings! I have this select, SELECT cust, ProjID, proj,

[sqlite] SELECTing WHERE calculation > 0

2014-05-29 Thread jose isaias cabrera
Greetings! I have this select, SELECT cust, ProjID, proj, A_No, bdate, CASE Xtra4 WHEN 'y' THEN vEmail ELSE 'noemail' END, sum(ProjFund), sum(ProjFund)-sum(CASE Xtra4 WHEN 'y' THEN invoice ELSE 0 END), sum(CASE Xtra4 WHEN 'y' THEN invoice ELSE 0 E

Re: [sqlite] sqlite4 Windows build

2014-05-29 Thread jose isaias cabrera
"Mickey" wrote... Hello, I've been tasked with integrating SQLite4 LSM for testing purposes into our project. I compiled the SQlite .a file under Ubuntu but I also need to create a Windows static library. Can someone please provide me some instruction on creating the Windows Static Library? T

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-28 Thread jose isaias cabrera
"Richard Hipp" wrote... On Wed, May 28, 2014 at 1:20 PM, jose isaias cabrera wrote: 3. Is there a spot anywhere that has clear steps on creating the Sqlite3 DLL? http://www.sqlite.org/draft/howtocompile.html#dll The "draft" page above will be promoted to the official

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-28 Thread jose isaias cabrera
"Richard Hipp" wrote... On Wed, May 28, 2014 at 12:56 PM, jose isaias cabrera wrote: Just noticed something... It may be nothing, but the MinGW built DLL has a size of 645KB while the MSVC built one has a size of 962KB. Just under 33% bigger. I hope there is nothing missing on

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-28 Thread jose isaias cabrera
"Richard Hipp" wrote... On Tue, May 27, 2014 at 10:50 AM, Richard Hipp wrote: On Tue, May 27, 2014 at 10:39 AM, jose isaias cabrera < cabr...@wrc.xerox.com> wrote: H... I am running the original DLL created for 3.8.4.3 on the WinXP and it works fine, so it was not a

Re: [sqlite] SQLite version 3.8.5 beta

2014-05-27 Thread jose isaias cabrera
"Jan Nijtmans" wrote... 2014-05-27 5:57 GMT+02:00 jose isaias cabrera : "Richard Hipp" wrote... Please report any problems to this mailing list and/or directly to me. I am having problem using the pre-built DLL: http://www.sqlite.org/snapshot/sqlite-dll-win32-

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-27 Thread jose isaias cabrera
"Richard Hipp" wrote... On Tue, May 27, 2014 at 10:50 AM, Richard Hipp wrote: On Tue, May 27, 2014 at 10:39 AM, jose isaias cabrera < cabr...@wrc.xerox.com> wrote: H... I am running the original DLL created for 3.8.4.3 on the WinXP and it works fine, so it was not a

Re: [sqlite] SQLite version 3.8.5 beta

2014-05-27 Thread jose isaias cabrera
"Richard Hipp" wrote... On Tue, May 27, 2014 at 10:39 AM, jose isaias cabrera wrote: "Jan Nijtmans" wrote... 2014-05-27 5:57 GMT+02:00 jose isaias cabrera : "Richard Hipp" wrote... Please report any problems to this mailing list and/or dir

Re: [sqlite] SQLite version 3.8.5 beta

2014-05-27 Thread jose isaias cabrera
"Jan Nijtmans" wrote... 2014-05-27 5:57 GMT+02:00 jose isaias cabrera : "Richard Hipp" wrote... Please report any problems to this mailing list and/or directly to me. I am having problem using the pre-built DLL: http://www.sqlite.org/snapshot/sqlite-dll-win32-x86

Re: [sqlite] SQLite version 3.8.5 beta

2014-05-26 Thread jose isaias cabrera
"Richard Hipp" wrote... Please download beta snapshots of SQLite 3.8.5 from http://www.sqlite.org/download.html and test them in your applications. We hope to release SQLite version 3.8.5 within the next few weeks. See http://www.sqlite.org/draft/releaselog/3_8_5.html for the current list of

Re: [sqlite] how to write this commands?

2014-05-16 Thread jose isaias cabrera
"Igor Tandetnik" wrote... On 5/16/2014 11:02 AM, Rob Richardson wrote: It took me a bit of looking, but I think I understand your query. One question remains: why did you use the max() function? It is, technically, not legal in SQL to use both an aggregate function ... [clip] matter which,

Re: [sqlite] BLOBs and NULLs

2014-04-22 Thread jose isaias cabrera
"Peter Aronson" wrote... If you want to use sqlite3_randomness to generate a Version 4 UUID according to RFC4122, the following code will can be used: unsigned char uuid_data[16]; /* We'll generate a version 4 UUID as per RFC4122. Start by generating 128 bits of randomness (we will use 122

Re: [sqlite] about "windows" downloadable versions

2014-03-07 Thread jose isaias cabrera
big stone" wrote... Hello, Wouldn't it be a good idea, for the "windows" download version, to propose also (or only) the "-o2 compiled" .dll and .exe versions ? (trading 300Ko of executable size for a 50% speed-up is a bargain, when you have a pc) I agree with this idea. If the embedded

Re: [sqlite] Error: near "SELECT": syntax error

2014-01-31 Thread jose isaias cabrera
Clemens Ladisch wrote... To: Sent: Friday, January 31, 2014 1:32 PM Subject: Re: [sqlite] Error: near "SELECT": syntax error jose isaias cabrera wrote: INSERT OR REPLACE INTO LSOpenProjects ( SELECT ... ) SQL does not allow parentheses here. all records ... that t

Re: [sqlite] Error: cannot commit - no transaction is active

2014-01-31 Thread jose isaias cabrera
Clemens Ladisch" wrote... jose isaias cabrera wrote: I would like to suggest that once a BEGIN is set, if there is a syntax error after a BEGIN, that BEGIN gets deactivated. This is not how the SQL standard says databases should work. sqlite> begin; sqlite> select foo FROM;

[sqlite] Error: near "SELECT": syntax error

2014-01-31 Thread jose isaias cabrera
Greetings and salutations! I have two Databases: 1. LocalDB 2. SharedDB The SharedDB has the latest updates made from different machines and different users. I would like to update the localDB record based on a date field (UpdateDate) that the SharedDB has, which is the latest. I have index

[sqlite] Error: cannot commit - no transaction is active

2014-01-31 Thread jose isaias cabrera
Greetings! Perhaps I have not right ask this, as I am a newbie to SQL (about 5 years), but, I would like to suggest that once a BEGIN is set, if there is a syntax error after a BEGIN, that BEGIN gets deactivated. For example: sqlite> begin; sqlite> select foo FROM; Error: near ";": syntax e

Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-30 Thread jose isaias cabrera
Wow! thanks for this. I have to read it slowly to capture the understanding of some of the syntax. But this is great! thanks. Stephen Chrzanowski" wrote... Untested and only from the SQL compiler in my brain -- This compiler is known to have a few bugs -- It may also be too late to go u

Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread jose isaias cabrera
James K. Lowden wrote... On Wed, 29 Jan 2014 23:37:43 + Simon Slavin wrote: By the way, once you have this working I would suggest (from my experience) that you change your database design a little. Instead of having a table containing just your open jobs, have a table containing all jo

Re: [sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread jose isaias cabrera
Simon Slavin wrote... On 29 Jan 2014, at 10:42pm, jose isaias cabrera wrote: The tables are created this way: CREATE TABLE OpenProjects (id integer primary key, ProjID integer, createDnT, unique(id)); CREATE TABLE OpenJobs (id integer primary key, ProjID integer, Task, unique(id

[sqlite] Keeping Track of Records of IDs in one table. Possible?

2014-01-29 Thread jose isaias cabrera
Greetings! I have two tables: OpenProjects and OpenJobs. OpenJobs have jobs that belong to one unique project (ProjID). OpenProjects are projects that have one project fathers a bunch of jobs. The design below is found in a localDB on the user's PC and also on a SharedDB file in a server t

Re: [sqlite] SELECTing from another SELECT

2014-01-25 Thread jose isaias cabrera
Igor Tandetnik wrote... On 1/23/2014 2:26 PM, St. B. wrote: SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a'); will probably fill the bill. If I where to run your query, I would do a select A.* from A inner join B on A.a = b.ProjId where b.ptask='a' Careful - this wil

Re: [sqlite] SELECTing from another SELECT

2014-01-25 Thread jose isaias cabrera
"Igor Tandetnik" wrote on Friday, January 24, 2014 9:48 AM... On 1/24/2014 9:28 AM, jose isaias cabrera wrote: Igor Tandetnik wrote... On 1/23/2014 2:26 PM, St. B. wrote: SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a'); will probably fill the

Re: [sqlite] SELECTing from another SELECT

2014-01-25 Thread jose isaias cabrera
St. B. wrote... SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a'); will probably fill the bill. If I where to run your query, I would do a select A.* from A inner join B on A.a = b.ProjId where b.ptask='a' the join may optimize better than the in (select ...) Thanks.

Re: [sqlite] SELECTing from another SELECT

2014-01-24 Thread jose isaias cabrera
"Igor Tandetnik" wrote on Friday, January 24, 2014 9:48 AM... On 1/24/2014 9:28 AM, jose isaias cabrera wrote: Igor Tandetnik wrote... On 1/23/2014 2:26 PM, St. B. wrote: SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a'); will probably fill the

Re: [sqlite] SELECTing from another SELECT

2014-01-24 Thread jose isaias cabrera
Igor Tandetnik wrote... On 1/23/2014 2:26 PM, St. B. wrote: SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a'); will probably fill the bill. If I where to run your query, I would do a select A.* from A inner join B on A.a = b.ProjId where b.ptask='a' Careful - this wil

Re: [sqlite] SELECTing from another SELECT

2014-01-23 Thread jose isaias cabrera
St. B. wrote... SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a'); will probably fill the bill. If I where to run your query, I would do a select A.* from A inner join B on A.a = b.ProjId where b.ptask='a' the join may optimize better than the in (select ...) Thanks.

Re: [sqlite] SELECTing from another SELECT

2014-01-23 Thread jose isaias cabrera
John McKown wrote... On Thu, Jan 23, 2014 at 1:11 PM, jose isaias cabrera wrote: Greetings! I have these tables A and B: A id,projid,a,b 1,1,'a','h' 2,2,'b','i' 3,3,'c','j' 4,4,'d','k' 5,5,'e','

Re: [sqlite] SELECTing from another SELECT

2014-01-23 Thread jose isaias cabrera
Igor Tandetnik wrote... On 1/23/2014 2:11 PM, jose isaias cabrera wrote: SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask = 'a'); You want WHERE projid IN (SELECT ...) IN operator accepts a set on the right; = operator only accepts a scalar (which comes from the

[sqlite] SELECTing from another SELECT

2014-01-23 Thread jose isaias cabrera
Greetings! I have these tables A and B: A id,projid,a,b 1,1,'a','h' 2,2,'b','i' 3,3,'c','j' 4,4,'d','k' 5,5,'e','l' ... ... B id,projid,ptask 101,1,'a' 102,2,'b' 103,3,'a' 104,4,'b' 105,5,'a' ... ... When I do this SELECT, SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask = 'a

Re: [sqlite] SQLite 2013 retrospective

2013-12-31 Thread jose isaias cabrera
Richard Hipp wrote... Here is a quick summary of the changes and enhancements to SQLite during 2013. The comparison is between trunk versions, [clip] Thanks so much for this info. Our goal is to maintain this aggressive pace of innovation and enhancement in SQLite throughout 2014 and beyon

Re: [sqlite] sqlite does not order greek characters correctly

2013-12-10 Thread jose isaias cabrera
"Simon Slavin" wrote... On 10 Dec 2013, at 4:23pm, jose isaias cabrera wrote: "Simon Slavin" wrote... If you're not already using it, please take a look at the International Components for Unicode: <http://www.sqlite.org/src/artifact?ci=trunk&filenam

Re: [sqlite] sqlite does not order greek characters correctly

2013-12-10 Thread jose isaias cabrera
"Simon Slavin" wrote... On 8 Dec 2013, at 9:34pm, Nikos Platis wrote: I tried to order a table by a column containing greek strings and I found out that sqlite does not sort them correctly. It probably uses the order of greek characters in the Unicode table, while the correct order is vas

Re: [sqlite] EXPLAIN QUERY PLAN

2013-11-18 Thread jose isaias cabrera
esendet: Freitag, 15. November 2013 18:08 An: General Discussion of SQLite Database Betreff: Re: [sqlite] EXPLAIN QUERY PLAN On 15 Nov 2013, at 4:29pm, jose isaias cabrera wrote: Is there any place that explain each of this entries? <http://www.sqlite.org/opcode.html> However, don't

Re: [sqlite] EXPLAIN QUERY PLAN

2013-11-15 Thread jose isaias cabrera
"Simon Slavin" wrote... On 15 Nov 2013, at 4:29pm, jose isaias cabrera wrote: Is there any place that explain each of this entries? <http://www.sqlite.org/opcode.html> However, don't feel you should understand them. They're for geeks only. The output from

Re: [sqlite] EXPLAIN QUERY PLAN

2013-11-15 Thread jose isaias cabrera
"Jay A. Kreibich" wrote... On Wed, Nov 13, 2013 at 12:20:42AM +, Walter Hurry scratched on the wall: On Tue, 12 Nov 2013 17:47:05 -0500, jose isaias cabrera wrote: > I am trying to speed up our queries and normalize our DB and I am > reading, > > http://www.sqlite.o

[sqlite] EXPLAIN QUERY PLAN

2013-11-12 Thread jose isaias cabrera
Greetings and salutations. I am trying to speed up our queries and normalize our DB and I am reading, http://www.sqlite.org/eqp.html But, I am missing a lot. Where do I read about the results and how to make changes to the DB to speed up/enhance the DB response? Thanks. josé __

Re: [sqlite] PRAGMA cache_size when copying data from two DBs

2013-11-07 Thread jose isaias cabrera
"Richard Hipp" asked... On Thu, Nov 7, 2013 at 10:13 AM, jose isaias cabrera wrote: Greetings! When copying data from two DBs, do the cache_size of PRAGMA needs to match both connection? What type of response, issues or problem would it cause when the two connection's PR

[sqlite] PRAGMA cache_size when copying data from two DBs

2013-11-07 Thread jose isaias cabrera
Greetings! When copying data from two DBs, do the cache_size of PRAGMA needs to match both connection? What type of response, issues or problem would it cause when the two connection's PRAGMA cache_size are different? thanks, josé ___ sqlite-u

Re: [sqlite] Database gets locked for other processes

2013-10-29 Thread jose isaias cabrera
"Martin Kropfinger" Am Tue, 29 Oct 2013 12:00:02 -0400 schrieb sqlite-users-requ...@sqlite.org: Date: Tue, 29 Oct 2013 14:51:08 +0100 From: Stephan Beal To: General Discussion of SQLite Database Subject: Re: [sqlite] Database gets locked for other processes Message-ID: Content-Type: text/pla

Re: [sqlite] Inserting or replacing in the same db based on one key

2013-10-11 Thread jose isaias cabrera
"James K. Lowden" wrote... On Thu, 10 Oct 2013 12:29:21 -0400 "jose isaias cabrera" wrote: > INSERT INTO SimplePrices > SELECT cust || '1', class, slang, tlang, TransferCost, Price > FROM SimplePrices WHERE cust = 'XEROX'; > > Kudos for

Re: [sqlite] Inserting or replacing in the same db based on one key

2013-10-10 Thread jose isaias cabrera
"James K. Lowden" wrote... On Wed, 9 Oct 2013 17:00:36 -0400 "jose isaias cabrera" wrote: CREATE TABLE SimplePrices ( cust TEXT, class TEXT, slang TEXT, tlang TEXT, TransferCost, Price,

[sqlite] Inserting or replacing in the same db based on one key

2013-10-09 Thread jose isaias cabrera
Greetings. I have this table creation code, CREATE TABLE SimplePrices ( cust TEXT, class TEXT, slang TEXT, tlang TEXT, TransferCost, Price, PRIMARY KEY (cust, class, slang, tlang)); and I have lots of data

Re: [sqlite] Version 3.8.1 beta

2013-10-01 Thread jose isaias cabrera
"Richard Hipp" wrote... SQLite version 3.8.1 will be published before too much longer, probably. You can find beta versions at http://www.sqlite.org/download.html Comments, criticisms, and third-party testing of this beta is appreciated. Installed it and tested our tool: it works as good as

Re: [sqlite] help needed for major SQLite problem

2013-09-01 Thread jose isaias cabrera
"C M" wrote... Keeping it simple: I have a Python application that uses SQLite, and I randomly get this error: "SQL logic error or missing database" Is the database in network drive or not in the same machine that is running the app? ___ sqli

[sqlite] To BEGIN or not to BEGIN. That is the question...

2013-08-28 Thread jose isaias cabrera
Greetings. I know that if I am doing INSERTs and such, I need to, BEGIN; INSERT... END; But, do I need to begin if I am going to create a table? ie. BEGIN; CREATE TABLE tableName ( JobID integer primary key, SubProjID integer, ProjID integer ); END; Also, what other co

Re: [sqlite] Version 3.7.17 Preview

2013-04-26 Thread jose isaias cabrera
"Richard Hipp" wrote... Please visit http://www.sqlite.org/draft/releaselog/3_7_17.html to see the proposed enhancements and changes in SQLite version 3.7.17. Your comments, criticisms and suggestions are welcomed and encouraged. Wow! Lots of new features... Sweet! Snapshot amalgamation

Re: [sqlite] SQLite version 3.7.16.2

2013-04-13 Thread jose isaias cabrera
"D. Richard Hipp" said... SQLite version 3.7.16.2 is now available on the SQLite website http://www.sqlite.org/ The 3.7.16.2 patch release contains a two-character change in the Windows OS interface that fixes a long-standing race condition that could lead to database corruption. This bu

Re: [sqlite] SQLite 3.7.17 preview - 2x faster?

2013-04-04 Thread jose isaias cabrera
"Richard Hipp" wrote... By making use of memory-mapped I/O, the current trunk of SQLite (which will eventually become version 3.7.17 after much more refinement and testing) can be as much as twice as fast, on some platforms and under some workloads. We would like to encourage people to try o

Re: [sqlite] Faster query result

2013-02-22 Thread jose isaias cabrera
"Cory Nelson" and the whole list wanted to know... On Fri, Feb 22, 2013 at 9:56 AM, jose isaias cabrera wrote: Greetings. which one is faster... #1. SELECT id FROM LSOpenJobs WHERE bdate BETWEEN '2012-01-01' AND '2012-12-31'; or this one... #2 SELECT

[sqlite] Faster query result

2013-02-22 Thread jose isaias cabrera
Greetings. which one is faster... #1. SELECT id FROM LSOpenJobs WHERE bdate BETWEEN '2012-01-01' AND '2012-12-31'; or this one... #2 SELECT id FROM LSOpenJobs WHERE bdate IN ('2012-01-01', ..., '2012-12-31)'; where , ..., would have all the rest of the dates. Thanks. josé ___

Re: [sqlite] Saving ubyte[] zlib data in sqlite and calling it back

2013-02-12 Thread jose isaias cabrera
Richard Hipp wrote... On Mon, Feb 11, 2013 at 1:45 PM, jose isaias cabrera wrote: Greetings. I have this table, CREATE TABLE Test (login primary key, password); and I would like to save zlib data using ubyte[] and also call it back in. Are you trying to store zlib-compressed content

Re: [sqlite] Saving ubyte[] zlib data in sqlite and calling it back

2013-02-11 Thread jose isaias cabrera
True... "Simon Slavin" wrote... On 12 Feb 2013, at 1:33am, jose isaias cabrera wrote: have you thought of including these as part of the normal sqlite core functions? I feel that zlib has nothing to do with SQL or databases. It doesn't belong in a database library.

Re: [sqlite] Saving ubyte[] zlib data in sqlite and calling it back

2013-02-11 Thread jose isaias cabrera
"Richard Hipp" wrote... On Mon, Feb 11, 2013 at 1:45 PM, jose isaias cabrera wrote: Greetings. I have this table, CREATE TABLE Test (login primary key, password); and I would like to save zlib data using ubyte[] and also call it back in. Are you trying to store zlib-compress

Re: [sqlite] Saving ubyte[] zlib data in sqlite and calling it back

2013-02-11 Thread jose isaias cabrera
Richard Hipp wrote... On Mon, Feb 11, 2013 at 1:45 PM, jose isaias cabrera wrote: Greetings. I have this table, CREATE TABLE Test (login primary key, password); and I would like to save zlib data using ubyte[] and also call it back in. Are you trying to store zlib-compressed content in

[sqlite] Saving ubyte[] zlib data in sqlite and calling it back

2013-02-11 Thread jose isaias cabrera
Greetings. I have this table, CREATE TABLE Test (login primary key, password); and I would like to save zlib data using ubyte[] and also call it back in. I have things like this: 1. To save in SQLite, cmd = " UPDATE Test password = " ~ cast(char[])cast(ubyte[])std.zlib.compress(cast

Re: [sqlite] Sum of various rows

2013-01-18 Thread jose isaias cabrera
"Michael Black" wrote... create table test (id,invoice,transfer,price); insert into test values(10,500,200,0); insert into test values(200,300,300,200); insert into test values(334,3000,200,3000); select sum(invoice),sum(transfer),sum(price) from test where id in (10,200,334); 3800|700|3200 S

[sqlite] Sum of various rows

2013-01-18 Thread jose isaias cabrera
Greetings. Very newbie question... I have these records... id,invoice, transfer, price 1,0,0,0 ... 10,500.00,200.00,0.00 ... 200,300,300, 200 ... 334,3000, 200,3000 ... what I would like to do is to add invoice, transfer and price. I have this, SELECT sum(invoice),sum(transfer),sum(price) whe

Re: [sqlite] Help with CASE WHEN

2011-06-19 Thread jose isaias cabrera
"Mr. Puneet Kishor" wrote... > > On Jun 19, 2011, at 10:04 PM, jose isaias cabrera wrote: > >> "Mr. Puneet Kishor" wrote... >>> >>> On Jun 19, 2011, at 5:12 PM, jose isaias cabrera wrote: >>> >>>> >>>>

Re: [sqlite] Help with CASE WHEN

2011-06-19 Thread jose isaias cabrera
"Mr. Puneet Kishor" wrote... > > On Jun 19, 2011, at 5:12 PM, jose isaias cabrera wrote: > >> >> "Nico Williams" wrote... >> >>> On Fri, Jun 17, 2011 at 5:05 PM, Mr. Puneet Kishor >>> wrote: >>>> The above is not SQL.

Re: [sqlite] Help with CASE WHEN

2011-06-19 Thread jose isaias cabrera
"Nico Williams" wrote... > On Fri, Jun 17, 2011 at 5:05 PM, Mr. Puneet Kishor > wrote: >> The above is not SQL. You can't have a SQL statement begin with CASE. SQL >> statements can only begin with either SELECT or UPDATE or CREATE or >> DELETE or ALTER, etc. CASE is an expression, and has to

[sqlite] Help with CASE WHEN

2011-06-17 Thread jose isaias cabrera
Greetings. I have used CASE before, but for simple codes and it works. However, I am trying to break down some calculations and it-s not working. I am getting, ...> ...> END; Error: near "CASE": syntax error sqlite> COMMIT TRANSACTION; Error: cannot commit - no transaction is active sql

Re: [sqlite] Better way to get records by IDs

2011-05-24 Thread jose isaias cabrera
"BareFeetWare", on Tuesday, May 24, 2011 8:31 AM wrote... On 23/05/2011, at 11:13 PM, jose isaias cabrera wrote: SharedDB file is about 600 megs shared over a network drive and it's getting slow, but if I get the specific record ID only with the select that I want, it'

Re: [sqlite] Better way to get records by IDs

2011-05-23 Thread jose isaias cabrera
"BareFeetWare", on Saturday, May 21, 2011 9:15 PM wrote... > Hi Jose, > >> I would like to get a bunch of records of IDs that I already know. For >> example, this table called Jobs, >> rec,...,data,... >> 1,...,aaa,... >> 2,...,zzz,... >> ... >> ... >> 99,...,azz,... > > In addition to the pure

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
then 1 > when 33 then 2 > when 37 then 3 > when 2 then 4 > when 1 then 5 > end; > > Martin Thanks, this will work. > > Am 20.05.2011 15:55, schrieb jose isaias cabrera: >> "Oliver Peters&

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
"Oliver Peters" on Friday, May 20, 2011 9:47 AM wrote... > jose isaias cabrera writes: > >> >> >> Greetings. >> >> I would like to get a bunch of records of IDs that I already know. For >> example, this table called Job

Re: [sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
"Martin Engelschalk", on Friday, May 20, 2011 9:04 AM wrote... > Hi, > > you want this: > > select * from Jobs where rec in (1, 2) > > Martin Darn it! Thanks. And that is easier... :-) > Am 20.05.2011 15:00, schrieb jose isaias cabrera: >> Greetin

[sqlite] Better way to get records by IDs

2011-05-20 Thread jose isaias cabrera
Greetings. I would like to get a bunch of records of IDs that I already know. For example, this table called Jobs, rec,...,data,... 1,...,aaa,... 2,...,zzz,... ... ... 99,...,azz,... I know I can do this call, begin; select * from Jobs where rec=1; select * from Jobs where rec=2; end; and tha

Re: [sqlite] Changing Date Format

2010-10-27 Thread jose isaias cabrera
"Max Vlasov" wrote... > On Wed, Oct 27, 2010 at 8:09 AM, jose isaias cabrera > wrote: > >> >> What I would like to do is a call that can fix the dates to the correct >> format, ie. -MM-DD, so that the final data looks like this, >> >> > H

Re: [sqlite] Changing Date Format

2010-10-27 Thread jose isaias cabrera
"BareFeetWare" wrote... > On 27/10/2010, at 3:09 PM, jose isaias cabrera wrote: > >> I know I can do a bunch of sets, such as this one, >> >> UPDATE table1 set d1 = '2010-01-01' >> where >> d1 = '2010-1-1'; >> >&g

[sqlite] Changing Date Format

2010-10-26 Thread jose isaias cabrera
Greetings and salutations. I have this data entry problem, that I have placed a fix for the users, but I have entries in the DB that have the wrong date format. There are dates entered in this format, 2010-1-1 instead of 2010-01-01. Say that I had this table, table1. id,st,ca,d1,d2 1,AA,BB,

<    1   2   3   4   5   6   7   >