Re: [sqlite] sqlite syntax auto suggest

2019-11-30 Thread Laurent Dhont
Dear Richard & others, Now it is clear but how do I let the user make for example an UPDATE query without the OR. I have UPDATE on position 0, then I want OR, OF, tableName. This works but SET is only available on position 4-5. I want this also on position 2. What I want to do is get a

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Domingo Alvarez Duarte
Hello Dominique ! Here are two views that can bring that info to a query: == CREATE VIEW rule_list_view AS SELECT     a.ruleid,     b.name,     a.lhs FROM rule AS a LEFT JOIN symbol AS b ON a.lhs = b.id; CREATE VIEW rulerhs_list_view AS SELECT     a.ruleid,     b.name as symbol_name,    

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Dominique Devienne
On Fri, Nov 29, 2019 at 2:10 PM Richard Hipp wrote: > On 11/29/19, Laurent wrote: > > > > Could you perhaps explain what pos means and what the [isTerminal] = > 0 rows mean. > > New check-in enhances the output to include a comment in the SQL > before the encoding of each production rule. This

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Richard Hipp
On 11/29/19, Laurent wrote: > > Could you perhaps explain what pos means and what the [isTerminal] = 0 > rows mean. > New check-in enhances the output to include a comment in the SQL before the encoding of each production rule. This should help make it clear what the SQL is trying to represent.

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Laurent
Dear Richard, This has been very helpful, I have the parse.sql file. I feel very flattered that you took the time to answer my question. My boss says you are the one that should win a nobel prize. This has been much appreciated!! I completely understand if you won't answer anymore but I

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Domingo Alvarez Duarte
Hello Richard ! Sorry by split my reply in so many small ones ! When trying to use the generate "parse.sql" I'm getting this: sqlite3 parse.db < parse.sql Error: near line 10: FOREIGN KEY constraint failed Error: near line 11: FOREIGN KEY constraint failed Error: near line 12: FOREIGN

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Domingo Alvarez Duarte
Hello Richard ! Again after rereading your reply and trying to use the "parse.sql" I noticed that it doesn't have a "begin;../commit;" wrapper as it's recommended to not having "fsync" calls on each insert. Cheers ! On 28/11/19 23:54, Richard Hipp wrote: On 11/28/19, Laurent Dhont wrote:

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Domingo Alvarez Duarte
Hello Richard ! My bad after writing the last reply I found that "EXPLAIN" and "explain" are different symbols there. Could a small comment be generated at the begin of the generated "parse.sql" ? Something like: (dummy example) --- -- This is a generated output from lemon parse

Re: [sqlite] sqlite syntax auto suggest

2019-11-29 Thread Domingo Alvarez Duarte
Hello Richard ! I just looked at it and I have some doubts about the generated parse.sql, as I see it there is this table: CREATE TABLE symbol(   id INTEGER PRIMARY KEY,   name TEXT NOT NULL,   isTerminal BOOLEAN NOT NULL,   fallback INTEGER REFERENCES symbol ); --and this entries

Re: [sqlite] sqlite syntax auto suggest

2019-11-28 Thread Richard Hipp
On 11/28/19, Laurent Dhont wrote: > is there an API to > get this information in a format that is not an image? By coincidence, I checked in a change two days ago that might be helpful. See https://www.sqlite.org/src/timeline?c=4dbd398d640852d4 for the specific check-in. If you now build

[sqlite] sqlite syntax auto suggest

2019-11-28 Thread Laurent Dhont
Hi all, I am trying to create a fully automated auto suggestion feature for my web application for sqlite. Currently this is going well, but I realized there are to many features in sqlite to hardcode this, so it will be near impossible and take a lot off time. The diagrams on the site of

Re: [sqlite] Syntax clarification

2018-12-28 Thread Stephen Chrzanowski
The .add indicates you're using some kind of dictionary type of class like a tStringList and would append that string to the end of that dictionary. The .Text would replace the contents of the dictionary with that string. On Friday, December 28, 2018, Dave Delage wrote: > I've searched without

Re: [sqlite] Syntax clarification

2018-12-28 Thread Jens Alfke
> On Dec 28, 2018, at 3:25 PM, Dave Delage wrote: > > What are the pros/cons of query.sql.text := 'some string'; versus > query.sql.add('some string'); That sounds like a Delphi (Pascal?) question, not anything about SQLite itself. I haven’t used Pascal since the 1980s, but it looks like

[sqlite] Syntax clarification

2018-12-28 Thread Dave Delage
I've searched without success for this answer. I use SQLite3, Zeos and Delphi so maybe this isn't a perfectly sqlite3 question but here goes:  What are the pros/cons of query.sql.text := 'some string'; versus  query.sql.add('some string'); Dave --- This email has been checked for

Re: [sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread David Wellman
Kingdom, GU1 3SR Registered company number: 3917021 Registered in England and Wales. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of R Smith Sent: 04 September 2017 12:49 To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite

Re: [sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread R Smith
One last thing I forgot to mention, on the topic of making INSERT and UPDATE easy - If you are using SQLite 3.15 or later, you can use Row-value functionality to UPDATE several fields in one go from a sub query. An example of how such an update query might look: WITH CTE(ID, ta, tb, tc) AS

Re: [sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread R Smith
On 2017/09/04 12:46 PM, David Wellman wrote: Hi Ryan, Thanks for that. It is certainly valid syntax and I'll do some testing to check that it gives me the correct answer. It's always a pleasure. Your email has 'crossed in the post' with my second one and you've answered something that I

Re: [sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread David Wellman
: Re: [sqlite] Syntax error using CTE and UPDATE You are essentially trying to use a CTE (which for the intents and purposes of the UPDATE SQL is just the same as using any other table) inside an UPDATE statement as if it is the main referenced table. In an UPDATE or INSERT however, there can

Re: [sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread David Wellman
- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of David Wellman Sent: 04 September 2017 11:23 To: 'SQLite mailing list' Subject: [sqlite] Syntax error using CTE and UPDATE Hi, (I have a feeling that this will be depressingly simple - but I just can't see

Re: [sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread R Smith
You are essentially trying to use a CTE (which for the intents and purposes of the UPDATE SQL is just the same as using any other table) inside an UPDATE statement as if it is the main referenced table. In an UPDATE or INSERT however, there can only ever be 1 single main referenced table

[sqlite] Syntax error using CTE and UPDATE

2017-09-04 Thread David Wellman
Hi, (I have a feeling that this will be depressingly simple - but I just can't see it right now.) The following code is failing with: Error: near line 3: no such column: dtls.mapname2 explain with dtls as (select distinct wrk.mapname as mapname2 ,udb.udb_key

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-08-16 Thread David Raymond
a|b|c 1|2|3 -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Roman Fleysher Sent: Friday, August 11, 2017 3:46 PM To: SQLite mailing list Subject: Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-08-11 Thread Roman Fleysher
: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of Richard Hipp [d...@sqlite.org] Sent: Friday, June 09, 2017 9:23 AM To: SQLite mailing list Subject: Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers On 6/9/17, Mark Brand <m

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 17:01, Domingo Alvarez Duarte wrote: I already did this before but it was not accepted. For myself I did a modification on sqlite3 to allow the use of "AS" on delete/update statements. You can see the parser part here

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 16:04, Paul Sanderson wrote: The SQLite syntax diagrams are my first point of call when looking at an error in my code like this. https://sqlite.org/lang_update.html "AS" and an alias are clearly not part of the statement. And that is how (with testing) I eventua

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 16:33, Clemens Ladisch wrote: John McMahon wrote: an alias for an "UPDATE" table name is not permitted. Is there a particular reason for this? The UPDATE statement affects a single table. While an alias might be a convenience, it is not necessary (any naming conflicts in

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 15:03, Keith Medcalf wrote: Do you know of any implementation of SQL that accepts an AS clause for the updated table? I don't think any do. No Keith, I don't. My only exposure to SQL is sqlite. Some versions have a FROM extension and you CAN specify an alias for the

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 17:01, Domingo Alvarez Duarte wrote: I already did this before but it was not accepted. For myself I did a modification on sqlite3 to allow the use of "AS" on delete/update statements. You can see the parser part here

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 16:33, Clemens Ladisch wrote: John McMahon wrote: an alias for an "UPDATE" table name is not permitted. Is there a particular reason for this? The UPDATE statement affects a single table. While an alias might be a convenience, it is not necessary (any naming conflicts in

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 16:04, Paul Sanderson wrote: The SQLite syntax diagrams are my first point of call when looking at an error in my code like this. https://sqlite.org/lang_update.html "AS" and an alias are clearly not part of the statement. And that is how (with testing) I eventua

Re: [sqlite] syntax error near AS

2017-07-06 Thread John McMahon
On 06/07/2017 15:03, Keith Medcalf wrote: Do you know of any implementation of SQL that accepts an AS clause for the updated table? I don't think any do. No Keith, I don't. My only exposure to SQL is sqlite. Some versions have a FROM extension and you CAN specify an alias for the

Re: [sqlite] syntax error near AS

2017-07-06 Thread Domingo Alvarez Duarte
I already did this before but it was not accepted. For myself I did a modification on sqlite3 to allow the use of "AS" on delete/update statements. You can see the parser part here https://github.com/mingodad/sqlite/blob/decimal64/src/parse.y . Cheers ! On 06/07/17 05:16, John McMahon

Re: [sqlite] syntax error near AS

2017-07-06 Thread Clemens Ladisch
John McMahon wrote: > an alias for an "UPDATE" table name is not permitted. Is there a particular > reason for this? The UPDATE statement affects a single table. While an alias might be a convenience, it is not necessary (any naming conflicts in subqueries can be resolved by using an alias on

Re: [sqlite] syntax error near AS

2017-07-06 Thread Paul Sanderson
The SQLite syntax diagrams are my first point of call when looking at an error in my code like this. https://sqlite.org/lang_update.html "AS" and an alias are clearly not part of the statement. Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1

Re: [sqlite] syntax error near AS

2017-07-05 Thread Keith Medcalf
sıɥʇ pɐǝɹ uɐɔ noʎ ɟı > -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > On Behalf Of John McMahon > Sent: Wednesday, 5 July, 2017 21:17 > To: SQLite Users > Subject: [sqlite] syntax error near AS > > Hi > > Wondering if someo

[sqlite] syntax error near AS

2017-07-05 Thread John McMahon
Hi Wondering if someone else can spot the syntax error in the following statement. "locns" is an attached database. There are four "AS" terms in the statement, they all alias tables. Ok, found it. It seems that an alias for an "UPDATE" table name is not permitted. Is there a particular

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-06-09 Thread Mark Brand
For non-TEMP triggers, the table to be modified or queried must exist in the same database as the table or view to which the trigger is attached. TEMP triggers are not subject to the same-database rule. A TEMP trigger is allowed to query or modify any table in any ATTACH

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-06-09 Thread Richard Hipp
On 6/9/17, Mark Brand wrote: > > > On 09/06/17 14:47, Richard Hipp wrote: >> The documentation has been updated to clarify the ambiguity and to >> hopefully make it easier to understand. > > Thanks. The exception for non-TEMP triggers is something I was hoping > for too: > >>

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-06-09 Thread Mark Brand
On 09/06/17 14:47, Richard Hipp wrote: The documentation has been updated to clarify the ambiguity and to hopefully make it easier to understand. Thanks. The exception for non-TEMP triggers is something I was hoping for too: For non-TEMP triggers, the table to be modified or queried must

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-06-09 Thread Richard Hipp
The documentation has been updated to clarify the ambiguity and to hopefully make it easier to understand. On 6/9/17, Mark Brand wrote: > According to the documentation: > > The name of the table to be modified in an UPDATE, DELETE, or INSERT > statement must be an

[sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-06-09 Thread Mark Brand
According to the documentation: The name of the table to be modified in an UPDATE, DELETE, or INSERT statement must be an unqualified table name. In other words, one must use just "tablename" not "database.tablename" when specifying the table. *The table to be modified must exist in

Re: [sqlite] Syntax. table-function-name vs table-naming-function-name

2017-03-26 Thread petern
Richard, thank you for your reply. I really appreciate it. The fact that you have carefully thought about how to cross the FROM clause barrier with expressions is itself a useful fact. If you say the current implementation is painted into a corner on this issue I believe you. It would be

Re: [sqlite] Syntax. table-function-name vs table-naming-function-name

2017-03-26 Thread Richard Hipp
On 3/25/17, petern wrote: > > Why can't we have a parallel syntax branch for scalar valued > "table-naming-function-name"? In other words, why not have support for > simply naming an existing table or view by return value of a scalar > function? > The easiest way

[sqlite] Syntax. table-function-name vs table-naming-function-name

2017-03-24 Thread petern
Consider the "table-or-subquery" syntax chart linked below. https://www.sqlite.org/syntax/table-or-subquery.html A modest proposal. In the "table-or-subquery" syntax there exists a branch for "table-function-name", aka table valued virtual tables. Why can't we have a parallel syntax branch for

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread R Smith
On 2016/01/18 11:42 PM, James Walker wrote: > Why do I get a syntax error from this SQL? > > SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM > FilmSizeOverrides); > > SQLite says the error is near SELECT, but doesn't say which SELECT. > If I say either It works fine for me - What

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread Richard Hipp
On 1/18/16, James Walker wrote: > Why do I get a syntax error from this SQL? > > SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM FilmSizeOverrides); > > SQLite says the error is near SELECT, but doesn't say which SELECT. Works when I try it. Is there a stray non-printing character

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread James Walker
On 1/18/2016 1:59 PM, R Smith wrote: > > > On 2016/01/18 11:42 PM, James Walker wrote: >> Why do I get a syntax error from this SQL? >> >> SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM >> FilmSizeOverrides); >> >> SQLite says the error is near SELECT, but doesn't say which SELECT. If >>

[sqlite] syntax error on SELECT with WHERE EXISTS

2016-01-18 Thread James Walker
Why do I get a syntax error from this SQL? SELECT * FROM SnappedFrames WHERE EXISTS (SELECT 1 FROM FilmSizeOverrides); SQLite says the error is near SELECT, but doesn't say which SELECT. If I say either SELECT * FROM SnappedFrames WHERE 1; or SELECT 1 FROM FilmSizeOverrides; then there's

Re: [sqlite] Syntax diagram missing in sqlite3 docs

2014-03-05 Thread Zsbán Ambrus
On 2/20/14, Zsbán Ambrus wrote: > The page "http://sqlite.org/lang_transaction.html; should show the > syntax diagrams for commit-stmt and rollback-stmt. It seems that these bugs are now fixed in the draft documentation for sqlite 3.8.4. Thank you, sqlite maintainers.

[sqlite] Syntax diagram missing in sqlite3 docs

2014-02-20 Thread Zsbán Ambrus
Hi, The page "http://sqlite.org/lang_transaction.html; should show the syntax diagrams for commit-stmt and rollback-stmt. Similarly, the page "http://sqlite.org/lang_savepoint.html; should show the diagram for rollback-stmt. These missing diagrams show up correctly in

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-02-03 Thread Zsbán Ambrus
On 1/30/14, Richard Hipp wrote: > Fixed. Do you see any more problems? Sqlite 3.8.3 is now released, but I found one more problem today. The page "http://sqlite.org/lang_transaction.html; should show the syntax diagrams for commit-stmt and rollback-stmt. Similarly, the page

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Richard Hipp
On Thu, Jan 30, 2014 at 3:07 PM, Zsbán Ambrus wrote: > On 1/30/14, Richard Hipp wrote: > > Thanks Kevin and Ambrus for the error reports. A revised copy of the > > documentation is up at http://www.sqlite.org/draft/lang_select.html - > > please let me know

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Zsbán Ambrus
On 1/30/14, Richard Hipp wrote: > Thanks Kevin and Ambrus for the error reports. A revised copy of the > documentation is up at http://www.sqlite.org/draft/lang_select.html - > please let me know if you see any other problems. Great, but the diagram for table-or-subquery still

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Richard Hipp
Another change to the select-stmt syntax diagram. I need to adjust the text to match, but I have to be away from my desk for a few minutes. More updates when I return. On Thu, Jan 30, 2014 at 12:39 PM, Richard Hipp wrote: > Thanks Kevin and Ambrus for the error reports. A

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Richard Hipp
Thanks Kevin and Ambrus for the error reports. A revised copy of the documentation is up at http://www.sqlite.org/draft/lang_select.html - please let me know if you see any other problems. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Kevin Benson
On Thu, Jan 30, 2014 at 10:58 AM, Richard Hipp wrote: > Documentation on SELECT statements at > http://www.sqlite.org/draft/lang_select.html has now been updated and > amplified. > > > On Thu, Jan 30, 2014 at 5:52 AM, Zsbán Ambrus wrote: > > > Hi! > > > >

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Zsbán Ambrus
On 1/30/14, Richard Hipp wrote: > Documentation on SELECT statements at > http://www.sqlite.org/draft/lang_select.html has now been updated and > amplified. Thank you, that seems cleaner. However, there seems to be an error. From the diagram for select-stmt and also in the

Re: [sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Richard Hipp
Documentation on SELECT statements at http://www.sqlite.org/draft/lang_select.html has now been updated and amplified. On Thu, Jan 30, 2014 at 5:52 AM, Zsbán Ambrus wrote: > Hi! > > I'm writing to you about the syntax diagram that appears on >

[sqlite] Syntax diagram in draft docs for sqlite 3.8.3 confuses me

2014-01-30 Thread Zsbán Ambrus
Hi! I'm writing to you about the syntax diagram that appears on "http://sqlite.org/draft/lang_select.html;, and is a draft for the next version of sqlite (3.8.3). I find this diagram confusing, and would rather prefer to have something similar to "http://sqlite.org/lang_select.html;, only of

Re: [sqlite] Syntax of EXPLAIN QUERY PLAN "detail" column

2013-11-01 Thread Constantine Yannakopoulos
On Fri, Nov 1, 2013 at 3:51 PM, Richard Hipp wrote: > I don't think anybody knows. The EXPLAIN QUERY PLAN syntax is not > formally > designed. It is intended for human reading, not machine parsing. It > changes from time to time and is not considered part of the SQLite >

Re: [sqlite] Syntax of EXPLAIN QUERY PLAN "detail" column

2013-11-01 Thread Richard Hipp
On Fri, Nov 1, 2013 at 9:38 AM, Constantine Yannakopoulos < alfasud...@gmail.com> wrote: > > Could > someone (probably an SQLite developer) tell me if this grammar covers all > cases of "detail" values or if there are cases I have missed? Maybe the > NGQP has introduced some changes I have

[sqlite] Syntax of EXPLAIN QUERY PLAN "detail" column

2013-11-01 Thread Constantine Yannakopoulos
Hello all, I am trying to write a utility that processes the results of EXPLAIN QUERY PLAN statements and presents them in a graphical manner to developers. I need to extract information from the "detail" column of the returned result set (e.g. table name, index name, estimated rows etc.) and

Re: [sqlite] Syntax control

2012-09-21 Thread Giuseppe Costanzi
On Fri, 2012-09-21 at 08:33 +0200, Giuseppe Costanzi wrote: > hi all, > could you check me the syntax of this statment? > > UPDATE batchs > SET > batchs.department_id = (SELECT > products.department_id > FROM products > WHERE >

[sqlite] Syntax control

2012-09-21 Thread Giuseppe Costanzi
hi all, could you check me the syntax of this statment? UPDATE batchs SET batchs.department_id = (SELECT products.department_id FROM products WHERE products.product_id = batchs.product_id)

Re: [sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Pavel Ivanov
>        sqlite> select sic, sic_desc, state, count(*) from Companies group by > sic; > The 'group by' phrase returns one row per group, which is what I want as > long as the group is a compound of industry number and state (the > description makes it easier to read and is fixed in association

Re: [sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Igor Tandetnik
Rich Shepard wrote: > The closest I've come so far is: > sqlite> select sic, sic_desc, state, count(*) from Companies group by sic; > The 'group by' phrase returns one row per group, which is what I want as > long as the group is a compound of industry number and

[sqlite] Syntax for Counting Rows By Multiple Groups

2010-09-21 Thread Rich Shepard
I've a table with 15 columns, including industry number, industry description, and state. I'm trying to formulate the proper SELECT statement to return the count of rows for each industry number/description in each of the 5 states. I've looked at the aggregate function chapter in Rick van der

Re: [sqlite] Syntax error on CREATE TRIGGER IF NOT EXISTS

2010-05-28 Thread Jim Terman
sqlite 3.3.6. I didn't realize it was so old. Thanks. Igor Tandetnik wrote: > Jim Terman wrote: > >> It looks like to me that CREATE TRIGGER IF NOT EXISTS is recognized by >> sqlite, but I get the following from the command line: >> >> sqlite> CREATE TABLE foo (id INTEGER

Re: [sqlite] Syntax error on CREATE TRIGGER IF NOT EXISTS

2010-05-28 Thread Igor Tandetnik
Jim Terman wrote: > It looks like to me that CREATE TRIGGER IF NOT EXISTS is recognized by > sqlite, but I get the following from the command line: > > sqlite> CREATE TABLE foo (id INTEGER PRIMARY KEY, value TEXT, > timestamp DATE);sqlite> CREATE TRIGGER IF NOT EXISTS foo_log

[sqlite] Syntax error on CREATE TRIGGER IF NOT EXISTS

2010-05-28 Thread Jim Terman
It looks like to me that CREATE TRIGGER IF NOT EXISTS is recognized by sqlite, but I get the following from the command line: sqlite> CREATE TABLE foo (id INTEGER PRIMARY KEY, value TEXT, timestamp DATE);sqlite> CREATE TRIGGER IF NOT EXISTS foo_log AFTER INSERT ON foo BEGIN INSERT INTO foo

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
args" --- On Sun, 3/14/10, P Kishor <punk.k...@gmail.com> wrote: > From: P Kishor <punk.k...@gmail.com> > Subject: Re: [sqlite] syntax for sqlite to query across 2 databases > To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> > Da

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread P Kishor
s Enter SQL statements terminated with a ";" sqlite> ATTACH DATABASE db2 AS db2; sqlite> SELECT t1.a, t2.b FROM t1 JOIN t2 ON t1.id = t2.id; a b -- -- blahmeh sqlite> Hope that helps. > > > --- On Sun, 3/14/10, Jay A. Kreibich <j...

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
t;select * from db1.args" SQL error: no such table: db1.args --- On Sun, 3/14/10, Jay A. Kreibich <j...@kreibi.ch> wrote: > From: Jay A. Kreibich <j...@kreibi.ch> > Subject: Re: [sqlite] syntax for sqlite to query across 2 databases > To: "General Discussion of S

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 06:22:15PM -0700, David Lyon scratched on the wall: > Can you or someone provide the exact syntax for ATTACH http://www.lmgtfy.com/?q=sqlite+attach+command=1 ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread Jay A. Kreibich
On Sun, Mar 14, 2010 at 05:01:18PM -0700, David Lyon scratched on the wall: > if I had a database called db1 with table tbl1 with field id and a > second db called db2 and a table called tbl2 with field id, whats the > correct syntax to query across the 2 databases eg: > > "select * db1..tbl1 a ,

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
m: P Kishor <punk.k...@gmail.com> > Subject: Re: [sqlite] syntax for sqlite to query across 2 databases > To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> > Date: Sunday, March 14, 2010, 9:02 PM > On Sun, Mar 14, 2010 at 6:01 PM, > David Lyon

Re: [sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread P Kishor
On Sun, Mar 14, 2010 at 6:01 PM, David Lyon wrote: > if I had a database called db1 with table tbl1 with field id and a second db > called db2 and a table called tbl2 with field id, whats the correct syntax to > query across the 2 databases eg: > > "select * db1..tbl1 a ,

[sqlite] syntax for sqlite to query across 2 databases

2010-03-14 Thread David Lyon
if I had a database called db1 with table tbl1 with field id and a second db called db2 and a table called tbl2 with field id, whats the correct syntax to query across the 2 databases eg: "select * db1..tbl1 a , db2..tbl2 b where a.id=b.id" This doesnt work, can someone modify it to work?

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Karl Brandt
2009/6/2 Kees Nuyt : > On Tue, 2 Jun 2009 10:35:12 -0300, Karl Brandt > wrote: >> >>Let me explain the complete picture so someone can help me. >> >>I develop a wrapper around sqlite that tracks the changed records and >>than save the changes to the database

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Kees Nuyt
On Tue, 2 Jun 2009 10:35:12 -0300, Karl Brandt wrote: >2009/6/2 J. King >> >> On Tue, 02 Jun 2009 07:40:01 -0400, Karl Brandt >> wrote: >> >> > I'm trying to set the conflict resolution of an entire transaction by >> > using the ON

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Karl Brandt
2009/6/2 J. King > > On Tue, 02 Jun 2009 07:40:01 -0400, Karl Brandt > wrote: > > > I'm trying to set the conflict resolution of an entire transaction by > > using the ON CONFLICT clause without success. > > > > [...] > > > > Is there a way to set the

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread J. King
On Tue, 02 Jun 2009 07:40:01 -0400, Karl Brandt wrote: > I'm trying to set the conflict resolution of an entire transaction by > using the ON CONFLICT clause without success. > > [...] > > Is there a way to set the conflict resolution for an entire transaction? Such a

Re: [sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Kees Nuyt
On Tue, 2 Jun 2009 08:40:01 -0300, Karl Brandt wrote: >I'm trying to set the conflict resolution of an entire transaction by >using the ON CONFLICT clause without success. > >I'm using the following syntax: > >BEGIN ON CONFLICT ROLLBACK; >INSERT INTO TableX (Id) Values (1);

[sqlite] Syntax to set the conflict resolution of a transaction

2009-06-02 Thread Karl Brandt
I'm trying to set the conflict resolution of an entire transaction by using the ON CONFLICT clause without success. I'm using the following syntax: BEGIN ON CONFLICT ROLLBACK; INSERT INTO TableX (Id) Values (1); INSERT INTO TableX (Id) Values (2); INSERT INTO TableX (Id) Values (3); COMMIT; But

Re: [sqlite] Syntax for column names?

2009-04-28 Thread D. Richard Hipp
On Apr 28, 2009, at 11:38 AM, Igor Tandetnik wrote: > Jean-Denis Muys wrote: >> My create table statement (program-generated from a text file) below >> yields a syntax error. > > Column names should be valid identifiers (a sequence of digits, > letters > and underscores

Re: [sqlite] Syntax for column names?

2009-04-28 Thread Igor Tandetnik
Jean-Denis Muys wrote: > My create table statement (program-generated from a text file) below > yields a syntax error. Column names should be valid identifiers (a sequence of digits, letters and underscores that doesn't begin with a digit), or else enclosed in double

Re: [sqlite] Syntax for column names?

2009-04-28 Thread P Kishor
On Tue, Apr 28, 2009 at 10:03 AM, Jean-Denis Muys wrote: > Hello, > > My create table statement (program-generated from a text file) below yields > a syntax error. > > I went to SQL syntax diagrams, and as far as I could see, the "table-name" > box is not detailed in its own

[sqlite] Syntax for column names?

2009-04-28 Thread Jean-Denis Muys
Hello, My create table statement (program-generated from a text file) below yields a syntax error. I went to SQL syntax diagrams, and as far as I could see, the "table-name" box is not detailed in its own diagram. I suspect SQLite doesn't like column names with two periods. It this it? Here is

Re: [sqlite] SQLite syntax railroad diagrams

2009-04-21 Thread Kees Nuyt
On Tue, 21 Apr 2009 12:04:58 -0400, Andrey Fedorov wrote: >Hi All, > >Does anyone know how the railroad-style syntax diagrams on this page were >made? > >http://sqlite.org/syntaxdiagrams.html According to From: "D. Richard Hipp" Date: Mon, 20 Apr 2009

Re: [sqlite] SQLite syntax railroad diagrams

2009-04-21 Thread Andrey Fedorov
Thank you kindly! On Tue, Apr 21, 2009 at 12:12 PM, D. Richard Hipp wrote: > > On Apr 21, 2009, at 12:04 PM, Andrey Fedorov wrote: > > > Hi All, > > > > Does anyone know how the railroad-style syntax diagrams on this page > > were > > made? > > > >

Re: [sqlite] SQLite syntax railroad diagrams

2009-04-21 Thread D. Richard Hipp
On Apr 21, 2009, at 12:04 PM, Andrey Fedorov wrote: > Hi All, > > Does anyone know how the railroad-style syntax diagrams on this page > were > made? > > http://sqlite.org/syntaxdiagrams.html > I just put up a new FAQ for this. http://www.sqlite.org/faq.html#q25 D. Richard Hipp

[sqlite] SQLite syntax railroad diagrams

2009-04-21 Thread Andrey Fedorov
Hi All, Does anyone know how the railroad-style syntax diagrams on this page were made? http://sqlite.org/syntaxdiagrams.html They're very nice :) Cheers, Andrey ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Syntax for sql 'insert' for text with comma

2008-11-27 Thread Martin.Engelschalk
Hi, text constants have to be set between single quotes: insert into sometable values ( 5 , 'text' ) If the text contains a single quote, double it: insert into sometable values ( 5 , 'Don''t do this' ) Martin Mauricio schrieb: > Hi, > > I would like to > > insert into sometable values (

[sqlite] Syntax for sql 'insert' for text with comma

2008-11-27 Thread Mauricio
Hi, I would like to insert into sometable values ( someid , text ) ; but 'text' contains a few commas, and then it would look like (...) values ( someid , text , text2 , text3 ) ; Is there a syntax to do that properly, maybe like C string constants ("text,\"text\",text\n")? Thanks, Maurício

Re: [sqlite] Syntax error

2008-10-16 Thread Igor Tandetnik
"Darryl Hebbes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am getting a syntax error like this : > > near ".": syntax error > > when I run the following code. > > > UPDATE site_profile > SET site_profile.title = (select site_profiletemp.title from Make it SET title =

[sqlite] Syntax error

2008-10-16 Thread Darryl Hebbes
Hi, I am getting a syntax error like this : near ".": syntax error when I run the following code. UPDATE site_profile SET site_profile.title = (select site_profiletemp.title from site_profiletemp where site_profile.title = site_profiletemp.title), site_profile.title = (select

Re: [sqlite] SQLite syntax diagrams

2008-10-06 Thread Wilson, Ron P
Of Klemens Friedl Sent: Monday, October 06, 2008 1:59 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite syntax diagrams 2008/10/3 D. Richard Hipp <[EMAIL PROTECTED]>: > http://www.sqlite.org/draft/syntaxdiagrams.html > http://www.sqlite.org/draft/lang.html

Re: [sqlite] SQLite syntax diagrams

2008-10-06 Thread BardzoTajneKonto
I find those diagrams less readable than text version. There are other problems besides my personal preferences: - text cannot be copied from pictures - syntax cannot be viewed with text-only browsers - site loads a little longer (there are still people that don't use broadband)

Re: [sqlite] SQLite syntax diagrams

2008-10-05 Thread Klemens Friedl
2008/10/3 D. Richard Hipp <[EMAIL PROTECTED]>: > http://www.sqlite.org/draft/syntaxdiagrams.html > http://www.sqlite.org/draft/lang.html The diagrams are nice and for some people probably easier to read than plain text BNF* syntax. Although, images have two disadvantages: 1) web search engines

Re: [sqlite] SQLite syntax diagrams

2008-10-05 Thread Darren Duncan
Gavin Kistner wrote: > The diagrams are read most easily left to right; rolling to a new line > greatly reduces the utility, IMO. Roughly 7% of the 'net is still > using 800x600, and surely far less of tech savvy audience. > > I suggest increasing the image width to at least 900px before >

  1   2   >