Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Keith Medcalf
Julian days count starting from noon Greenwich Mean Time on January 1, 4713 BC, proleptic Julian calendar. Technically, to store a correct Julian Day floating point number you would have to take the localtime, convert it to GMT, then get the Julian Day. When you retrieve the Julian Day, you

Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Keith Medcalf
Yes, either will work. That is if you are using dates only, you can use the date function. Similarly if you are using times only you can use the time function. If you might have both, then you need to use the datetime function, which can validate correct time, date+time, or time only (if

Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Simon Slavin
On 10 Aug 2014, at 1:51am, Philip Bennefall wrote: > That is what I tried to do in my query examples that I included in the > original message. Based on those, would you say that I am doing it correctly? I didn't figure out what you actually have stored in the database.

Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Philip Bennefall
Hi Keith, Thanks for the explanation. From what I can see in your example, the only difference from mine is that I used date(x) and you used datetime(x). If I am understanding things correctly, this would give the same behavior if I am only concerned about dates? In this case I don't care

Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Philip Bennefall
Hi Simon, That is what I tried to do in my query examples that I included in the original message. Based on those, would you say that I am doing it correctly? Kind regards, Philip Bennefall On 8/9/2014 11:49 PM, Simon Slavin wrote: On 9 Aug 2014, at 9:53pm, Philip Bennefall

[sqlite] Updating records from a SELECT that exists in the table

2014-08-09 Thread jose isaias cabrera
Greetings! Long story... But, I have to update a DB from another DB if the record in the DB to be updated contains that record. So, with an attached DB, ATTACH 'somedb.sqlite' as client; I execute this command, BEGIN; INSERT OR REPLACE INTO LSOpenProjects SELECT * FROM

Re: [sqlite] SQLite 3.8.6 beta

2014-08-09 Thread Keith Medcalf
Both the extension entrypoints are missing from the DLL ... sqlite3_enable_load_extension sqlite3_load_extension >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of big stone >Sent: Saturday, 9 August, 2014 16:01 >To:

Re: [sqlite] SQLite 3.8.6 beta

2014-08-09 Thread Keith Medcalf
I believe the compile options were not set right. sqlite3_enable_load_extensions has not been exported. >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of big stone >Sent: Saturday, 9 August, 2014 16:01 >To:

Re: [sqlite] SQLite 3.8.6 beta

2014-08-09 Thread big stone
complementary information : - compiling manually sqlite.dll , I have no issue, - so the problem, if problem, is the official Sqlite.dll downloadble from sqlite.org. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Keith Medcalf
The result of converting an "invalid" datetime string with julianday() is a floating point julianday value which corresponds to the normalized datetime. In your example, date(julianday('2005-02-29')) is '2005-03-01' which is the correct normalized date. Therefore, a function which will

Re: [sqlite] SQLite 3.8.6 beta

2014-08-09 Thread big stone
hello, Maybe i did a wrong manipulation. Using latest beta dll on windows / python3.3, I get this strange error : import sqlite3 as sqlite File "C:\Users\famille\Documents\winpython\WinPython-32bit-3.3.5.0\python-3.3.5\lib\sqlite3\__init__.py", line 23, in from sqlite3.dbapi2 import *

Re: [sqlite] Checking whether a given date is valid

2014-08-09 Thread Simon Slavin
On 9 Aug 2014, at 9:53pm, Philip Bennefall wrote: > Is it safe to rely on the conversion between the floating point julianday and > the date string being accurate if the date is in fact valid? Probably not. The safest thing is to turn the string into a number (probably

[sqlite] Checking whether a given date is valid

2014-08-09 Thread Philip Bennefall
Hi all, I'm working on a project where I need to verify that a given date actually existed (like February 29 in a particular year). I am using SqLite to store a lot of data already and I didn't feel like hunting for a datetime library online. I figured that there should be a way to use

Re: [sqlite] archive of database

2014-08-09 Thread Tony Papadimitriou
My recommendation is to dump the SQLite database into a corresponding .sql file, and then compress that ASCII file using your favorite compressor (ZIP, RAR, etc.) In my view, this method has two advantages over copying the actual binary file for backup purposes, but no obvious disadvantages.

Re: [sqlite] archive of database

2014-08-09 Thread Simon Slavin
On 9 Aug 2014, at 12:18pm, Levente Kovacs wrote: > I mean... is SQLite designed to support the move of the sqlite file? Yes. If the database was closed properly, all your data is in one file. SQLite does not care where file is: you can move it from one folder or disk

Re: [sqlite] What am I doing wrong?

2014-08-09 Thread Luuk
On 8-8-2014 23:57, Errol Emden wrote: The SQL script you wrote actually provides the same information as mine - it lists all movies that Julie Andrews is in but it does NOT provide who is the leading actor in each movie, as all names selected is that of Julie Andrews. must have missed that

[sqlite] archive of database

2014-08-09 Thread Levente Kovacs
Dear List, Is it a recommended method to archive or copy a database just copying the sqlite file, or should I make a dump of the database, and move the SQL statements? I mean... is SQLite designed to support the move of the sqlite file? What if a new version of the library comes out? Will it be

Re: [sqlite] Prevent non-Integers going into int fields.

2014-08-09 Thread Richard Warburton
Thanks Peter, that's exactly what I wanted. I've gone with your first (more strict) solution. Cheers. Date: Sat, 02 Aug 2014 22:42:41 -0700 From: Peter Aronson To: sqlite-users@sqlite.org Subject: Re: [sqlite] Prevent non-Integers going into int fields. Message-ID: