[sqlite] Problem with SQLite version 3.9.2 together with user authentication extension

2015-11-26 Thread Simon Slavin
On 25 Nov 2015, at 8:25pm, Ulrich Telle wrote: > SELECT name, rootpage, sql FROM 'main'.sqlite_master ORDER BY rowid Can you try that again without the quotes around "main" ? SELECT name, rootpage, sql FROM main.sqlite_master ORDER BY rowid Simon.

[sqlite] Problem with SQLite version 3.9.2 together with user authentication extension

2015-11-26 Thread Ulrich Telle
Am 26.11.2015 um 01:30 schrieb Simon Slavin: > > On 25 Nov 2015, at 8:25pm, Ulrich Telle wrote: > >> SELECT name, rootpage, sql FROM 'main'.sqlite_master ORDER BY rowid > > Can you try that again without the quotes around "main" ? > > SELECT name, rootpage, sql FROM main.sqlite_master ORDER BY

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread no...@null.net
On Wed Nov 25, 2015 at 10:45:07AM +, Simon Slavin wrote: > > REFERENCES foreign-table ( column-name [[, column-name]]) ... > > It would be useful if rather than having to specify a column name for > each item one could specify a fixed value (or perhaps an expression, > though that might be

[sqlite] drop, create and copy a table

2015-11-26 Thread R Smith
On 2015/11/26 4:08 AM, H?ctor Fiandor wrote: > Dear Mr. Hipp and other members: > > I have a table where I have introduced a lot of information during 2015. > > In December 31, I have to select the records to be continue in 2016. > Previously, I have obtained a copy of the 2015 table for any

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-26 Thread Kirill Müller
On 25.11.2015 16:32, Clemens Ladisch wrote: > Kirill M?ller wrote: >> For a left join with a subquery on the right-hand side, that subquery >> doesn't seem to be flattened. > This is rule 3 of . Thanks, missed that. While true, I wonder if this

[sqlite] drop, create and copy a table

2015-11-26 Thread Héctor Fiandor
Dear Mr. Smith and Dr. Hipp: Thanks very much for your answers. I have learned a lot from your messages. Reviewing old message I found one from Mr. Smith that confirm this routines, that I have found previously but I miss something, and need to do all this in three "phases", I need to close the

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Simon Slavin
On 26 Nov 2015, at 7:42am, nomad at null.net wrote: > Which column in the customers table should contain the fixed value or > expression? The items listed in the REFERENCES clause should be handled in the same order as they would if they were all column names. It's just that instead of

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Bernardo Sulzbach
I am not against this feature request, Simon. But enlighten my why this cannot be done with a CHECK constraint? I may be missing something very simple. Thanks.

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Simon Slavin
On 26 Nov 2015, at 1:36pm, Bernardo Sulzbach wrote: > I am not against this feature request, Simon. But enlighten my why > this cannot be done with a CHECK constraint? I may be missing > something very simple. Thanks. Can you refer to another table in a CHECK constraint ? It never occurred

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Bernardo Sulzbach
I did not mean that. But if you want to check that a certain row has a valid value like you described, check ((job='dealer' or job='agent') or can_discount='no') Could do the trick, right? If you want, you can be more aggressive and go for check can_discount='no' or ((job='dealer' or

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Simon Slavin
On 26 Nov 2015, at 1:52pm, Bernardo Sulzbach wrote: > I did not mean that. But if you want to check that a certain row has a > valid value like you described, > >check ((job='dealer' or job='agent') or can_discount='no') That works only when the "job" column is in the table the

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Bernardo Sulzbach
Oh, OK. I thought they were in the same table. On Thu, Nov 26, 2015 at 11:56 AM, Simon Slavin wrote: > > On 26 Nov 2015, at 1:52pm, Bernardo Sulzbach > wrote: > >> I did not mean that. But if you want to check that a certain row has a >> valid value like you described, >> >>check

[sqlite] TCL link error

2015-11-26 Thread to...@acm.org
I?ve been compiling new versions for a long time now, and I just noticed this (so I don?t know how long it?s been there). Here?s the relevant output from the compilation: -- tclsqlite.c lib.exe /NOLOGO /LIBPATH:c:\tcl\lib /OUT:libtclsqlite3.lib tclsqlite.lo

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-26 Thread Clemens Ladisch
Kirill M?ller wrote: > On 25.11.2015 16:32, Clemens Ladisch wrote: >> Kirill M?ller wrote: >>> For a left join with a subquery on the right-hand side, that subquery >>> doesn't seem to be flattened. >> >> This is rule 3 of . > > I wonder if this

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-26 Thread Kirill Müller
On 26.11.2015 21:12, Clemens Ladisch wrote: > Kirill M?ller wrote: >> On 25.11.2015 16:32, Clemens Ladisch wrote: >>> Kirill M?ller wrote: For a left join with a subquery on the right-hand side, that subquery doesn't seem to be flattened. >>> This is rule 3 of

[sqlite] FOREIGN KEY enhancement request

2015-11-26 Thread Keith Medcalf
That is incorrect. Whether or not the customer "can_discount" is an attribute of the customer. Whether or not a sale "has_discount" applied is an attribute of the sale. They are not the same attribute, do not mean the same things, and are attributes of different tables. Business logic

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-26 Thread Keith Medcalf
Would it not be more efficient to say: select 1 from t1 limit 1; ? > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Kirill M?ller > Sent: Thursday, 26 November, 2015 15:03 > To: SQLite

[sqlite] method for thousands separator via sed post processing

2015-11-26 Thread Bruce Hohl
Thanks to suggestions on this list I explored the sed post processing avenue and found a solution. There are quite a few sed docs at http://sed.sourceforge.net For my needs I adapted an example from http://www-rohan.sdsu.edu/doc/sed.html (These docs are like ancient scrolls.) # add commas to

[sqlite] sqlite3_errmsg and wide char

2015-11-26 Thread Scott Robison
On Thu, Nov 26, 2015 at 10:13 PM, Igor Korot wrote: > > Hi, > Is there any way to have "sqlite3_errmsg" function return a wide char string? > Or do a conversion in a portable way? > > Thank you. The portable way would be to use the mbstowcs function from stdlib.h, though it depends on what

[sqlite] SQLite3 API

2015-11-26 Thread Robert W.Mills (Phoenix)
To all, I have written (in COBOL) an SQLite3 interface for GnuCOBOL and would like to add a routine that will return the number of rows that were selected, updated or deleted by the last executed SQL statement. I currently have a routine, named DBSQL, that calls sqlite3_prepare_v2,