A lot of replies.  To be clear, this is not a quirk of the shell and I'm
not just monkeying around looking for haphazard guesses about why I'm
"trying to change the SQL standard".  The following query sent through
sqlite3_exec() produces the following output:

SELECT max([],[:1]) FROM (VALUES (1,2),(3,4));
max([],[:1])
2
4

This is what SQLite 3.19.3 VALUES clause presently does independently of
shell.c.  My question would be, is this feature going to produce stable
column names going forward caveat the strange behavior of double quotes.

Simon, your rhetorical question asking how having an inconsistent number of
columns in the VALUES list makes sense is non-sequitur.  I am not proposing
some illogical bizarre syntax.  I hope you see how your remark is out of
line and amounts to noise on this thread.

The bug here is how the VALUES logic can't have it both ways.  If double
quotes are invalid for column value literals they should be rejected or at
least ignored.  They should not suddenly be injected into the column
name(s) observed by the outer scope of the VALUES clause.   That is of
course unless there is a software easter egg here that, depending on as yet
undisclosed well crafted literal values, allows the column names to be
elegantly specified in addition to the row values.

Also sent through sqlite3_exec():

SELECT * FROM (VALUES ("1",2),(3,4));
1,
1,2
3,4




On Sat, Jul 8, 2017 at 6:01 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
>
> On 9 Jul 2017, at 1:44am, Keith Medcalf <kmedc...@dessus.com> wrote:
>
> > I can't visualize what you mean.  Something like:
> >
> > create view constants (col1, col2) as values (1,1), (1,2);
> >
> > seems the most straightforward to me, and allows you to assign column
> names to the data.
>
> But that’s not SQL syntax, is it ?  (Read that in a puzzled voice.  I
> genuinely don’t know.) You’re just using the word VALUE as if it does what
> you want.
>
> I was thinking of a CREATE TABLE command, and a SELECT command with "AS"
> clauses.  Or of something similar with a VIEW.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to