[sqlite] FW: I'm trying to figure out how to ...

2014-09-18 Thread Keith Medcalf
Read only scrollable snapshot cursors can be easily implemented in the same way as they are implemented in other database engines. You just have to do the work yourself. Example: cn = sqlite3.connection(...) cr = cr.cursor() # create the scrollable cursor cr.execute('create temporary table

Re: [sqlite] FW: I'm trying to figure out how to ...

2014-09-18 Thread RSmith
On 2014/09/18 08:18, Keith Medcalf wrote: ...long article... Thanks Keith for taking the time, I imagine this is a topic you are passionate about and I think it should be published somewhere as an article because it will save lives of beginner DBA/Programmers for millenia to come - I have

Re: [sqlite] I'm trying to figure out how to ...

2014-09-18 Thread RSmith
On 2014/09/18 05:38, Mark Halegua wrote: I'm racking my brain trying to figure out how to get directly to the last item in a (potentially) sorted or ordered table. At least oe of the tables will be ordered by a name and a date, so uising the rtowid won't work. Also, how to traverse a table

Re: [sqlite] I'm trying to figure out how to ...

2014-09-18 Thread John McKown
And _excellent_ reply. I'm grabbing this email to put as a "gist" on my github account. From my own experience, programmers who come from a "non-relational" background, the world view of how to _properly_ do SQL is difficult. On Thu, Sep 18, 2014 at 12:14 AM, Keith Medcalf

Re: [sqlite] Provider not showing up in .Net Model import wizard

2014-09-18 Thread Freeliner
The problems in this question closely resemble those which I have met with my project with Visual Studio support. I've followed recommendations by visiting http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki and choosing *sqlite-netFx40-setup-bundle-x86-2010-1.0.94.0.exe* to

Re: [sqlite] I'm trying to figure out how to ...

2014-09-18 Thread Pavlos Christoforou
Thanks Keith, We have taken the liberty to forward your answer to our whole dev team, your insights on the subject are useful to all of us. Cheers Pavlos On 18 September 2014 07:14, Keith Medcalf wrote: > > You cannot do any of these things in any relational database.

Re: [sqlite] FW: I'm trying to figure out how to ...

2014-09-18 Thread Simon Slavin
On 18 Sep 2014, at 9:38am, RSmith wrote: > Thanks Keith for taking the time, I imagine this is a topic you are > passionate about and I think it should be published somewhere as an article > because it will save lives of beginner DBA/Programmers for millenia to come - > I

[sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
Which function in the sqlite generates the Vdbe program for the given query? Let's take an example of the join of two tables. Table A has n columns and Table B has m columns, and the result has n+m columns. During the execution of the Vdbe program the values from these columns get copied to the

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Richard Hipp
On Thu, Sep 18, 2014 at 10:10 AM, Prakash Premkumar wrote: > Which function in the sqlite generates the Vdbe program for the given > query? > > Let's take an example of the join of two tables. Table A has n columns and > Table B has m columns, and the result has n+m

Re: [sqlite] I'm trying to figure out how to ...

2014-09-18 Thread Mark Halegua
Kieth, Thanks for the reply. I should have asked sooner and would have wasted less time trying to do something sqlite wasn't meant for. I will however look up rolling cursors. That may help a little. Again, thanks. Mark On Wednesday, September 17, 2014 11:14:36 PM Keith Medcalf wrote:

Re: [sqlite] I'm trying to figure out how to ...

2014-09-18 Thread Nico Williams
If you do a select with the an ORDER BY ... DESC (or ASC) LIMIT 1, with the order-by clause matching one of the indexes on that table, then you'll get the last row without having to use a rowid. For example: CREATE TABLE person (firstname TEXT, lastname TEXT, stuff TEXT, PRIMARY KEY (lastname,

[sqlite] Why can't you find the Wiki by Navigation from the Homepage?

2014-09-18 Thread Sebastian
recently there was this on the mailing list: > Date: Thu, 18 Sep 2014 10:38:38 +0200 > From: RSmith > > On 2014/09/18 08:18, Keith Medcalf wrote: > > ...long article... > > Thanks Keith for taking the time, I imagine this is a topic you are > passionate about and I think

Re: [sqlite] Why can't you find the Wiki by Navigation from the Homepage?

2014-09-18 Thread Richard Hipp
On Thu, Sep 18, 2014 at 5:31 PM, Sebastian < sebastianspublicaddr...@googlemail.com> wrote: > > But a page like this already exists in the Wiki: > > http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor > > I guess one reason why this isn't known more might be that this Wiki can't > be reached by

Re: [sqlite] Provider not showing up in .Net Model import wizard

2014-09-18 Thread Joe Mistachkin
Freeliner wrote: > > I still do not see any SQLite DataSource: > > > > I am sure there must be some important step which I have missed after > installation. > I will appreciate any suggestions on this topic. > Are you

[sqlite] An order by problem, maybe a bug?

2014-09-18 Thread Mark Halegua
I've come upon a problem in sqlite3. Here's the table: CREATE TABLE contributors( contrib_id integer primary key, contrib_lname char not null, contrib_fname char, contrib_mname char, writer int, artist int, editor int) I've inserted several names. When I order by contrib_lname,

Re: [sqlite] An order by problem, maybe a bug?

2014-09-18 Thread Simon Slavin
On 19 Sep 2014, at 12:40am, Mark Halegua wrote: > Here are the commands: > > select * from contributors order by contrib_lname, contrib_fname; (works > properly) > select * from contributors order by contrib_lname, contrib_fname desc; (get > the same order > as

Re: [sqlite] An order by problem, maybe a bug?

2014-09-18 Thread Mark Halegua
Simon, that resolved it. I didn't know you needed to put the desc with both columns. It means another table I had thought was properly ordered wasn't. Thank you. Mark On Friday, September 19, 2014 12:50:57 AM Simon Slavin wrote: > On 19 Sep 2014, at 12:40am, Mark Halegua

Re: [sqlite] Provider not showing up in .Net Model import wizard

2014-09-18 Thread Freeliner
Looks like I found a small workaround for absence of SQLite DataSource in the list when trying to start New Connection after choosing "Update Model From Database..." or "Generate Database from Model..." from your edmx file: Strangely, but "SQLite Database File" data source *exists* in the same

[sqlite] Performance regression between 3.7.17 and 3.8.0.2?

2014-09-18 Thread Merike
Hi everyone, Since upgrading to Kubuntu 14.04 I've had an issue with Quassel irc client being slow on startup when it retrieves backlog from database. I've tracked it down to different sqlite version being installed. Previously I had 3.7.17 and now have 3.8.2. I've tried various versions from

Re: [sqlite] I'm trying to figure out how to ...

2014-09-18 Thread FarSight Data Systems
Kieth, Thanks for the reply. I should have asked sooner and would have wasted less time trying to do something sqlite wasn't meant for. I will however look up rolling cursors. That may help a little. Again, thanks. Mark On Wednesday, September 17, 2014 11:14:36 PM Keith Medcalf wrote:

Re: [sqlite] An order by problem, maybe a bug?

2014-09-18 Thread Simon Slavin
On 19 Sep 2014, at 1:15am, Mark Halegua wrote: > that resolved it. I didn't know you needed to put the desc with both columns. > > It means another table I had thought was properly ordered wasn't. > > Thank you. You're welcome. Glad you figured it out. By the way

Re: [sqlite] Performance regression between 3.7.17 and 3.8.0.2?

2014-09-18 Thread Richard Hipp
On Thu, Sep 18, 2014 at 8:54 AM, Merike wrote: > Hi everyone, > > Since upgrading to Kubuntu 14.04 I've had an issue with Quassel irc > client being slow on startup when it retrieves backlog from database. > I've tracked it down to different sqlite version being installed. >

Re: [sqlite] Performance regression between 3.7.17 and 3.8.0.2?

2014-09-18 Thread Richard Hipp
On Thu, Sep 18, 2014 at 8:54 AM, Merike wrote: > Hi everyone, > > Since upgrading to Kubuntu 14.04 I've had an issue with Quassel irc > client being slow on startup when it retrieves backlog from database. > I've tracked it down to different sqlite version being installed. >

Re: [sqlite] An order by problem, maybe a bug?

2014-09-18 Thread FarSight Data Systems
Thanks, I'll keep it in min. In this case, howevery, I don't think that will be an issue. All of the names are from American published pulp magazines, writers, artists, and editors. Mark On Friday, September 19, 2014 02:02:30 AM Simon Slavin wrote: > On 19 Sep 2014, at 1:15am, Mark Halegua

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
Thanks for your reply. I would like to know how the register allocation decision is made and the part of the code which does it . can you please help me find that? Thanks On 18 Sep 2014 20:20, "Richard Hipp" wrote: > On Thu, Sep 18, 2014 at 10:10 AM, Prakash Premkumar < >

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Richard Hipp
On Fri, Sep 19, 2014 at 12:10 AM, Prakash Premkumar wrote: > Thanks for your reply. I would like to know how the register allocation > decision is made and the part of the code which does it . can you please > help me find that? Thanks > Which register. Show me a

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Simon Slavin
On 19 Sep 2014, at 5:10am, Prakash Premkumar wrote: > Thanks for your reply. I would like to know how the register allocation > decision is made and the part of the code which does it . can you please > help me find that? Thanks Prakesh, perhaps it would help to read

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
Let's take this example explain select * from employee,company,location where location.name= company.name and location.name=employee.name; addr opcode p1p2p3p4 p5 comment - - -- - 0 Init

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Richard Hipp
On Fri, Sep 19, 2014 at 12:35 AM, Prakash Premkumar wrote: > Let's take this example > > explain select * from employee,company,location where location.name= > company.name and location.name=employee.name; > > > How's the register for the highlighted opcode allocated and

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Richard Hipp
On Fri, Sep 19, 2014 at 12:35 AM, Prakash Premkumar wrote: > Let's take this example > > explain select * from employee,company,location where location.name= > company.name and location.name=employee.name; > Also please include the schema for your database. > > addr

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
The opcode I'm interested in is 10 column 2 1 3 00 On 19 Sep 2014 10:11, "Richard Hipp" wrote: > On Fri, Sep 19, 2014 at 12:35 AM, Prakash Premkumar < > prakash.p...@gmail.com> > wrote: > > > Let's take this example > > > > explain select * from employee,company,location where

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
The schema is as follows : create table employee (name text,age int); create table location (name text,addr text); create table company (name text,cname text); Thanks On Fri, Sep 19, 2014 at 10:13 AM, Richard Hipp wrote: > On Fri, Sep 19, 2014 at 12:35 AM, Prakash Premkumar <

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Richard Hipp
You start by presenting us with a stand-alone script that we can run to see your question. See you are getting free help, you really should be striving to make it easy for people to help you. We don't have a script from you, so I made one up. I'm using: CREATE TABLE employee(eid INTEGER

Re: [sqlite] Generating VDBE program

2014-09-18 Thread Prakash Premkumar
Thanks a lot Richard for your help. I apologize for not including the script. I will make it a point to add the scripts from hereon. On Fri, Sep 19, 2014 at 10:30 AM, Richard Hipp wrote: > You start by presenting us with a stand-alone script that we can run to see > your