Re: [sqlite] Possible automatic ON CONFLICT resolution via DEFAULTS

2014-10-10 Thread James K. Lowden
On Thu, 9 Oct 2014 11:16:25 -0400 Stephen Chrzanowski wrote: > On Wed, Oct 8, 2014 at 8:38 PM, James K. Lowden > wrote: > > > > > The problem I see with your suggestion is that I can't think of > > another situation, with or without NULL, with or

Re: [sqlite] Curious datetime/strftime BUG?

2014-10-10 Thread John
On 6/10/2014 18:35, Clemens Ladisch wrote: John wrote: On 5/10/2014 19:59, Clemens Ladisch wrote: The documentation says: | These functions only work for dates between -01-01 00:00:00 and | -12-31 23:59:59. For dates outside that range, the

Re: [sqlite] Will someone be able to explain this weird outcome...

2014-10-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/10/2014 01:18 PM, jose isaias cabrera wrote: > I was able to figure out that comma's are more important than just > a 1000 number delemeter, so I received the right answer by taking > the commas out: To help avoid this in the future, be aware

Re: [sqlite] Check if file exists in SQL syntax?

2014-10-10 Thread Keith Medcalf
You do not say what operating system, but for example, on Windows, the following function works: SQLITE_PRIVATE void _GetFileAttributes(sqlite3_context *context, int argc, sqlite3_value **argv) { sqlite3_result_int(context, GetFileAttributesW(sqlite3_value_text16(argv[0]))); } which is

Re: [sqlite] Will someone be able to explain this weird outcome...

2014-10-10 Thread Simon Slavin
On 10 Oct 2014, at 9:27pm, to...@acm.org wrote: > sqlite> select "7,915" - "5,021"; > 2 > > But, would someone explain the result of 2? Sorry for this child-like > question, but I can't find the how the result of 2 came to be displayed. 7 - 5 = 2 Simon.

Re: [sqlite] maintaining order state for custom functions in sqlite: is it possible to insure that callback gets records in "ORDER BY" order?

2014-10-10 Thread Clemens Ladisch
john soprych wrote: > Is there a good way to create functions in sqlite where you can insure that > your function callback will be called in order? No. Your best bet is writing the query in such a way that the function is applied to an already ordered sequence: SELECT myfunc(x) FROM (SELECT

[sqlite] maintaining order state for custom functions in sqlite: is it possible to insure that callback gets records in "ORDER BY" order?

2014-10-10 Thread john soprych
Is there a good way to create functions in sqlite where you can insure that your function callback will be called in order? The api currently has support for purely functional functions and result set aggregates, but neither require that their respective callbacks are called in sort order

Re: [sqlite] how set the threading mode with ado.net sqlite provider

2014-10-10 Thread Joe Mistachkin
korkless wrote: > > hi, how can i set the threading mode at Start-time/Run-time as descrived > here https://www.sqlite.org/threadsafe.html? > i have searched also in the source code but i cannot find any api or > connectionstring option to do it > The threading mode cannot currently be set

Re: [sqlite] Will someone be able to explain this weird outcome...

2014-10-10 Thread Jean-Christophe Deschamps
select 7,915 - 5,021 is: select 7, 915 - 5, 021 giving 7 91021 just like select 'a', 915 - 5, 'b' ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Will someone be able to explain this weird outcome...

2014-10-10 Thread tonyp
Apparently, in trying to make numbers out of strings, it is interpreted as 7 - 5 = 2 and the part after the comma is truncated. -Original Message- From: jose isaias cabrera sqlite> select "7,915" - "5,021"; 2 But, would someone explain the result of 2? Sorry for this child-like

[sqlite] Will someone be able to explain this weird outcome...

2014-10-10 Thread jose isaias cabrera
Greetings! select 7,915 - 5,021; displays this result: 7|910|21 I was really looking to have 2,894 returned, but instead I received the above. Then, I added quotes, sqlite> select "7,915" - "5,021"; 2 sqlite> select '7,915' - '5,021'; 2 I was able to figure out that comma's are more

Re: [sqlite] sqlite data source not available

2014-10-10 Thread Kevin Benson
On Fri, Oct 10, 2014 at 11:55 AM, Ben Lam wrote: > Hi, > > Really appreciate any help, spent a day and a half trying to figure this > out without success. I can't get 'System.Data.SQLite Database File' to show > up as an option I the 'choose data source' window. > > My

Re: [sqlite] Check if file exists in SQL syntax?

2014-10-10 Thread Igor Tandetnik
On 10/10/2014 2:20 PM, Krzysztof wrote: I'm collecting file names (full paths) in sqlite table. Each day I need to remove non existing files from this table (thousands records). I'm wondering if SQLite has such function (could not find it in core functions). SQLite doesn't have such a function

[sqlite] How to use multiple connections with locking_mode=exclusive

2014-10-10 Thread Deon Brewis
Richard implied in this bug that you can use locking_mode=exclusive when you have a single process using that database, but that process has multiple threads & connections: https://bugzilla.mozilla.org/show_bug.cgi?id=993556 However, I've tried this and can't get it to work - the second open

[sqlite] Check if file exists in SQL syntax?

2014-10-10 Thread Krzysztof
Hi, I'm collecting file names (full paths) in sqlite table. Each day I need to remove non existing files from this table (thousands records). For now I'm selecting all records and then checking if file exists using C++ routine and if not then deleting it. I'm wondering if SQLite has such function

Re: [sqlite] Stored Procedures

2014-10-10 Thread Nico Williams
You can't change the NEW "row" in trigger bodies. Since you can't make "SELECT"s (or virtual tables) this way, all your "stored procedure" can do is INSERT/UPDATE/DELETE anyways. Using coalesce(NEW.foo, "default value") works fine (and it's how you'd default "SP arguments"). Nico --

[sqlite] sqlite data source not available

2014-10-10 Thread Ben Lam
Hi, Really appreciate any help, spent a day and a half trying to figure this out without success. I can't get 'System.Data.SQLite Database File' to show up as an option I the 'choose data source' window. My environment: VS2010 SP1, WIN 8.1 PRO 1. Installed

[sqlite] how set the threading mode with ado.net sqlite provider

2014-10-10 Thread korkless
hi, how can i set the threading mode at Start-time/Run-time as descrived here https://www.sqlite.org/threadsafe.html? i have searched also in the source code but i cannot find any api or connectionstring option to do it note: i'm using the last release for .net 4 thanks

[sqlite] Shell not returning 1 on error

2014-10-10 Thread John Taylor
This error occurs in 3.8.6: $ echo 'foo' > /tmp/foo.sql $ sqlite3 /tmp/foo.db < /tmp/foo.sql Error: incomplete SQL: foo $ echo $? 0 0 is the return code from sqlite3 and this should instead return 1 since an error occured. shell.c:3644 if( nSql ){ if(

Re: [sqlite] Stored Procedures

2014-10-10 Thread Mark Lawrence
On Thu Oct 09, 2014 at 05:38:57PM -0500, Nico Williams wrote: > I use triggers, particularly INSTEAD OF INSERT triggers on VIEWs. > The values of the columns of the rows to be "inserted" are the > "stored procedure's" arguments. I would like to able to do this too, but INSTEAD OF INSERT on a view