Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Simon Slavin
On 7 Jan 2017, at 10:54pm, Gan Uesli Starling wrote: > As for the suggestion to 'normalize' my four tables to one ... yes, I could > do that ... but it would make for a LOT of redundant data duplicated in > plural columns, which seems to me in my doubtless ignorant newbie

Re: [sqlite] warning on glob [was: SQLite3 Tutorial error]

2017-01-07 Thread dandl
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Will Parsons >>>I dug up some old references to investigate this further: >>>a) The UNIX C Shell Field Guide (1986): Ranges in the pattern [lower-upper] mentioned, no mention of negation of pattern.

Re: [sqlite] SQLite3 Tutorial error

2017-01-07 Thread dandl
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin > How about adding the above to the permanent docs? >>>SQLite docs do not usually include examples or tutorial information. It >>>would be more consistent just to take the text which is

Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Gan Uesli Starling
Okay. Thank you everyone for the suggestions given thus far. I am SQLite version 3.15.2 if that's of import. Know all that the whole database project is on-line here: ky8d.net/sql As for the suggestion to 'normalize' my four tables to one ... yes, I could do that ... but it would make for a

Re: [sqlite] sqlite3_result_subtype and sqlite3_value_subtype, what are they used for?

2017-01-07 Thread Bart Smissaert
OK, thanks. RBS On Sat, Jan 7, 2017 at 7:24 PM, Richard Hipp wrote: > On 1/7/17, Bart Smissaert wrote: > > Maybe a strange question, but what are these methods used for? > > Does anybody have a real example? > > Invented and used to distinguish JSON

Re: [sqlite] sqlite3_result_subtype and sqlite3_value_subtype, what are they used for?

2017-01-07 Thread Richard Hipp
On 1/7/17, Bart Smissaert wrote: > Maybe a strange question, but what are these methods used for? > Does anybody have a real example? Invented and used to distinguish JSON from plain text in the JSON1 extension. https://www.sqlite.org/json1.html -- D. Richard Hipp

[sqlite] Allow overriding unsigned 64-bit integer

2017-01-07 Thread Kirill Müller
Hi all I'm in a situation [1] where I compile RSQLite as part of a C++ project that still uses the C++98 standard. This means there's no portable support for 64-bit integers. I'm working around this issue by using a struct of size 8, but this means I need to override the "unsigned 64-bit

[sqlite] sqlite3_result_subtype and sqlite3_value_subtype, what are they used for?

2017-01-07 Thread Bart Smissaert
Maybe a strange question, but what are these methods used for? Does anybody have a real example? RBS ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite3 Tutorial error

2017-01-07 Thread James K. Lowden
On Fri, 06 Jan 2017 13:48:26 -0700 "Keith Medcalf" wrote: > Both "glob" and "like" call the same function, likeFunc with > different sets of user_data. likeFunc does a bunch of validation > then calls patternCompare which actually implements the like and glob >

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread James K. Lowden
On Sat, 7 Jan 2017 10:58:56 +0100 gwenn wrote: > After 3.16, > sqlite3_step returns SQLITE_DONE > and > sqlite3_column_count does not return 0 but 6 That is the correct answer. The function returns a set of rows. Every invocation returns the same number of columns. Some

Re: [sqlite] sqlite-users Digest, Vol 109, Issue 7

2017-01-07 Thread James K. Lowden
On Sat, 7 Jan 2017 16:40:04 +0100 Simone Mosciatti wrote: > Now it comes a write statement, something like: `INSERT INTO ...` > I push that statement in a buffer and I ack to the client that is > request is been processed. Now it comes another write statement, > `UPDATE

Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread R Smith
I'm not sure that CTE's are allowed inside triggers, but even so, it will need to be appended to each update. I think a real table (albeit a temporary one) will do much better - It should simply be a placeholder for variables, but has the benefit of being able to be joined to other queries,

Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Simon Slavin
On 7 Jan 2017, at 2:27pm, Gan Uesli Starling wrote: > CREATE TRIGGER _160m_Increment > AFTER UPDATE ON qso WHEN >NEW.freq LIKE '1.%' > BEGIN >SELECT country AS c FROM qth WHERE rowid = NEW.qth_other_id; >SELECT state AS s FROM qth WHERE rowid = NEW.qth_other_id;

Re: [sqlite] sqlite-users Digest, Vol 109, Issue 7

2017-01-07 Thread Simon Slavin
On 7 Jan 2017, at 12:22pm, Simone Mosciatti wrote: > yes, of course I am doing the sequence prepare(), step()*, finalize() > > Starts from here: > https://github.com/RedBeardLab/rediSQL/blob/master/rediSQL.c#L174 Okay. That’s fine. We get posts here from people who

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread gwenn
Sorry, I mean that there are impacts on SQLite wrappers: https://github.com/xerial/sqlite-jdbc/commit/42557128d56da563126003180fd8b8e8978ec818#diff-5a06ee6e8dbd2f4087ab8d361df52832 https://github.com/gwenn/gosqlite/commit/ac9891a74d94fb57679407bd36b80a5be218c6d6

Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Doug Currie
On Sat, Jan 7, 2017 at 9:27 AM, Gan Uesli Starling wrote: > So I'm trying to accumulate data for state/prov inside of USA, Canada and > Mexico, and country for the rest of the world. > > Since country and state from the same update are factors in incrementing > each of four

Re: [sqlite] sqlite-users Digest, Vol 109, Issue 7

2017-01-07 Thread Simone Mosciatti
Hi James, sorry I didn't see you email earlier... No idea why... You are completely right on your question. However to answer those question I would need to know how rediSQL would be used, which I can't. Right now I can only deference those choice to whoever is using it. /2) I need some

Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Kees Nuyt
On Sat, 7 Jan 2017 09:27:57 -0500, Gan Uesli Starling wrote: > So I'm trying to accumulate data for state/prov inside of USA, Canada > and Mexico, and country for the rest of the world. > > Since country and state from the same update are factors in incrementing > each of

[sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Gan Uesli Starling
So I'm trying to accumulate data for state/prov inside of USA, Canada and Mexico, and country for the rest of the world. Since country and state from the same update are factors in incrementing each of four tables, I was hoping to simplify it with a single select with 'AS' and then re-use the

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread Richard Hipp
On 1/7/17, gwenn wrote: > Hello, > You should try executing a PRAGMA with no result such as: > PRAGMA table_info('no_such_table'); > > Before 3.16, > sqlite3_step returns SQLITE_DONE > and > sqlite3_column_count returns 0 > > After 3.16, > sqlite3_step returns SQLITE_DONE >

Re: [sqlite] SQLite3 Tutorial error

2017-01-07 Thread Richard Hipp
On 1/7/17, Simon Slavin wrote: > > > > I have a question to add. How unicode-compliant are these functions ? There is the usual ASCIi-only case-folding for LIKE. But otherwise, the function should work with

[sqlite] warning on glob [was: SQLite3 Tutorial error]

2017-01-07 Thread Will Parsons
On Friday, 6 Jan 2017 3:48 PM -0500, Keith Medcalf wrote: > > On Friday, 6 January, 2017 12:49, James K. Lowden > wrote: > >> On Fri, 6 Jan 2017 10:23:06 +1100 >> "dandl" wrote: >> >> > Unix globbing for Linux is defined here: >> >

Re: [sqlite] sqlite-users Digest, Vol 109, Issue 7

2017-01-07 Thread Simone Mosciatti
Hi Simon, yes, of course I am doing the sequence prepare(), step()*, finalize() Starts from here: https://github.com/RedBeardLab/rediSQL/blob/master/rediSQL.c#L174 However, even if I wasn't do it, I should just see an increase in memory, not a so steep decrease in performance, correct?

Re: [sqlite] SQLite3 Tutorial error

2017-01-07 Thread Simon Slavin
On 7 Jan 2017, at 6:27am, dandl wrote: > How about adding the above to the permanent docs? SQLite docs do not usually include examples or tutorial information. It would be more consistent just to take the text which is currently comments in the source code file and include

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread gwenn
Hello, You should try executing a PRAGMA with no result such as: PRAGMA table_info('no_such_table'); Before 3.16, sqlite3_step returns SQLITE_DONE and sqlite3_column_count returns 0 After 3.16, sqlite3_step returns SQLITE_DONE and sqlite3_column_count does not return 0 but 6 Regards. On Fri,