Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Simon Slavin
On 23 Oct 2017, at 5:24am, John R. Sowden wrote: > i think there are too many errors in this guide for me to use it. The guide is fine. You made mistakes when you copied it. You should be able to copy and past the text straight from the page:

Re: [sqlite] [EXTERNAL] xRowid and read only virtual tables....

2017-10-22 Thread Hick Gunter
If your xBestIndex function indicates that your virtual table supports an index on the constraint with cost x and you have a single OR clause, the QP will assign a cost of 2*x to performing 2 keyed lookups/partial table scans If your XbestIndex function indicates that your virtual tabel does no

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Keith Medcalf
#!python # sqlite3_test, a test of python and sqlite import sqlite3 connection = sqlite3.connect(':memory:') # create a table connection.execute('create table events(ts, msg)') # insert values connection.executemany('insert into events values(?,?)', [(1, 'foo'), (2,'bar'), (3,'baz') ] ) #

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread John R. Sowden
thank you.  i think there are too many errors in this guide for me to use it. John On 10/22/2017 09:03 PM, Keith Medcalf wrote: There are a number of syntax errors. Line 1 - You have an / that should not be there. Line 6 - You cannot call a module, only a function in a module (not strictly

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Keith Medcalf
There are a number of syntax errors. Line 1 - You have an / that should not be there. Line 6 - You cannot call a module, only a function in a module (not strictly true, but in the case of pysqlite2, it is) Line 12 - You are missing the closing quote on the SQL string Line 17 - You have not inden

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Simon Slavin
On 23 Oct 2017, at 4:48am, John R. Sowden wrote: > ^C./sqlite3_test.py: line 7: syntax error near unexpected token `(' > ./sqlite3_test.py: line 7: `connection = sqlite3.connect(':memory:')' > john@sentry35:~$ Okay, you need someone who knows more about python to help you out. Hope someone’s

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread John R. Sowden
^C./sqlite3_test.py: line 7: syntax error near unexpected token `(' ./sqlite3_test.py: line 7: `connection = sqlite3.connect(':memory:')' john@sentry35:~$ On 10/22/2017 08:44 PM, Simon Slavin wrote: connection = sqlite3.connect(':memory:') same john _

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Simon Slavin
On 23 Oct 2017, at 4:42am, John R. Sowden wrote: > I just checked my file with a hex editor (ghex) and found they are all hex > 27. Okay, they’re correct. Try replacing the line it’s complaining about with connection = sqlite3.connect(':memory:') Simon. ___

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread John R. Sowden
I just checked my file with a hex  editor (ghex) and found they are all hex 27. John On 10/22/2017 08:27 PM, Simon Slavin wrote: On 23 Oct 2017, at 4:13am, John R. Sowden wrote: error from terminal program: ./sqlite3_test.py: line 6: syntax error near unexpected token `(' ./sqlite3_test.py

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Simon Slavin
On 23 Oct 2017, at 4:13am, John R. Sowden wrote: > error from terminal program: > ./sqlite3_test.py: line 6: syntax error near unexpected token `(' > ./sqlite3_test.py: line 6: `connection = sqlite3(':memory:')' > john@sentry35:~$ Please make absolutely sure that you are using the quote charac

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread John R. Sowden
i just switched to python3 - no difference in error On 10/22/2017 08:13 PM, John R. Sowden wrote: error from terminal program: ./sqlite3_test.py: line 6: syntax error near unexpected token `(' ./sqlite3_test.py: line 6: `connection = sqlite3(':memory:')' john@sentry35:~$ version 2.7.12 (ubuntu

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread John R. Sowden
error from terminal program: ./sqlite3_test.py: line 6: syntax error near unexpected token `(' ./sqlite3_test.py: line 6: `connection = sqlite3(':memory:')' john@sentry35:~$ version 2.7.12 (ubuntu 16,04 lts) John On 10/22/2017 08:07 PM, Igor Korot wrote: Hi, John, On Sun, Oct 22, 2017 at 9

Re: [sqlite] very sqlite3 noobie error

2017-10-22 Thread Igor Korot
Hi, John, On Sun, Oct 22, 2017 at 9:59 PM, John R. Sowden wrote: > Since I am trying to learn sqlite3 (unlearning foxpro) I find that python is > the simpleist language, wfich allows me to focus on sqlite, I amtrying the > =guide just sent to the list. > > I am getting a syntax error on line 5.

[sqlite] very sqlite3 noobie error

2017-10-22 Thread John R. Sowden
Since I am trying to learn sqlite3 (unlearning foxpro) I find that python is the simpleist language, wfich allows me to focus on sqlite, I amtrying the =guide just sent to the list. I am getting a syntax error on line 5.  below is the program copied by hand from the guide: --

[sqlite] Incorrect explain query plan print

2017-10-22 Thread korablev
CREATE TABLE t1(a PRIMARY KEY, b, c) WITHOUT ROWID; INSERT INTO t1 VALUES(1, 1, 1); EXPLAIN QUERY PLAN SELECT min(c) FROM t1; This query emits: "SEARCH TABLE t1 USING PRIMARY KEY". However, it is not really SEARCH, but SCAN TABLE. It can be seen from opcodes for VM. (Indeed, we should traverse thr

[sqlite] Article about using sqlite3 in Python

2017-10-22 Thread Simon Slavin
I don’t know enough about Python to evaluate this, but the sqlite3 side is sound, and some readers might find it useful. Simon. ___ sqlite-users mailing list sqlite-users@mailinglis