Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Pavel Ivanov
> In my code, I delete the view before attempting to recreate it by > executing the prepared statement.  Isn't that the time to validate > whether there are semantic problems with the statement? Yes, "validation" happens only at the time of execution. So you are apparently doing something wrong

[sqlite] ANN: SQLite PHP Generator 10.8 released

2010-08-26 Thread SQL Maestro Group
Hi! SQL Maestro Group announces the release of SQLite PHP Generator 10.8, a GUI frontend that allows you to generate high-quality PHP scripts for the selected SQLite tables, views and queries for the further working with these objects through the web.

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Drake Wilson
Quoth Simon Slavin , on 2010-08-26 13:38:36 +0100: > I'm sorry to ask this, but can you check for us whether a VIEW by > that name really does exist ? Don't forget, VIEWs get saved in the > file, they're not part of the attachment. And to add to that: if you want them to

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Alan Chandler
On 26/08/10 12:20, Pavel Ivanov wrote: > Yes, "validation" happens only at the time of execution. So you are > apparently doing something wrong and you better show your code. > easiest is to provide links to a copy. I've added a .txt extension to all the files to stop them being executed by

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Alan Chandler
On 26/08/10 13:38, Simon Slavin wrote: > > On 26 Aug 2010, at 12:12pm, Alan Chandler wrote: > >> This time it reported that the view it would have created failed because >> the table (view) already existed. > > I'm sorry to ask this, but can you check for us whether a VIEW by that name > really

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Simon Slavin
On 26 Aug 2010, at 3:36pm, Alan Chandler wrote: > On 26/08/10 13:38, Simon Slavin wrote: >> >> On 26 Aug 2010, at 12:12pm, Alan Chandler wrote: >> >>> This time it reported that the view it would have created failed because >>> the table (view) already existed. >> >> I'm sorry to ask this,

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Pavel Ivanov
>>> I'm sorry to ask this, but can you check for us whether a VIEW by that name >>> really does exist ?  Don't forget, VIEWs get saved in the file, they're not >>> part of the attachment. >> >> Yes it does > > So you are trying to create a VIEW which does already exist.  In that case, > there's

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Jay A. Kreibich
On Thu, Aug 26, 2010 at 04:32:11PM +0100, Simon Slavin scratched on the wall: > > On 26 Aug 2010, at 3:36pm, Alan Chandler wrote: > > > On 26/08/10 13:38, Simon Slavin wrote: > >> > >> On 26 Aug 2010, at 12:12pm, Alan Chandler wrote: > >> > >>> This time it reported that the view it would have

[sqlite] SQL script help.

2010-08-26 Thread Kirk Clemons
I have heard about SQL scripts that can automate some processes. Is it possible to write a script that performs the following on an entire database? SELECT * FROM myTable WHERE _rowid_ = 100; SELECT * FROM myTable WHERE _rowid_ = 101; SELECT * FROM myTable WHERE _rowid_ = 102; Regards, Kirk

Re: [sqlite] SQL script help.

2010-08-26 Thread Simon Slavin
On 26 Aug 2010, at 3:39pm, Kirk Clemons wrote: > SELECT * FROM myTable WHERE _rowid_ = 100; SELECT * FROM myTable WHERE > _rowid_ = 101; SELECT * FROM myTable WHERE _rowid_ = 102; SELECT * FROM myTable WHERE _rowid_ BETWEEN 100 AND 102 or SELECT * FROM myTable WHERE _rowid_ >= 100 AND

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Igor Tandetnik
Jay A. Kreibich wrote: > On Thu, Aug 26, 2010 at 04:32:11PM +0100, Simon Slavin scratched on the wall: >> >> On 26 Aug 2010, at 3:36pm, Alan Chandler wrote: >> >>> On 26/08/10 13:38, Simon Slavin wrote: On 26 Aug 2010, at 12:12pm, Alan Chandler wrote: > This

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Jay A. Kreibich
On Thu, Aug 26, 2010 at 11:59:03AM -0400, Igor Tandetnik scratched on the wall: > Jay A. Kreibich wrote: > >> So you are trying to create a VIEW which does already exist. In that > >> case, there's no mystery about why you're getting an error message. > > > > No, he's trying

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Simon Slavin
On 26 Aug 2010, at 4:59pm, Igor Tandetnik wrote: > Jay A. Kreibich wrote: >> On Thu, Aug 26, 2010 at 04:32:11PM +0100, Simon Slavin scratched on the wall: >>> >>> On 26 Aug 2010, at 3:36pm, Alan Chandler wrote: >>> On 26/08/10 13:38, Simon Slavin wrote: >>> >>> So you

Re: [sqlite] SQL script help.

2010-08-26 Thread Israel Lins Albuquerque
Or you can do: SELECT * FROM myTable WHERE _rowid_ IN (100, 101, 102) depending what you want - "Simon Slavin" escreveu: > > On 26 Aug 2010, at 3:39pm, Kirk Clemons wrote: > > > SELECT * FROM myTable WHERE _rowid_ = 100; SELECT * FROM myTable WHERE > > _rowid_

Re: [sqlite] Fw: Re: SQlite JDBC driver - need help

2010-08-26 Thread Israel Lins Albuquerque
I want to finish that confusion! 1st point: JSP means Java Server Pages and runs on an Apache TomCat server. The java code runs ON server and NOT in client! 2nd: Then the db files don't need be directed accessed by the web client, this is unsafe. Exemple:

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Alan Chandler
On 26/08/10 17:38, Simon Slavin wrote: > So someone can check it out. Try it with a VIEW that definitely doesn't > exist, or use > > CREATE VIEW IF NOT EXISTS ... > As far as I can work it out, the statement then prepares OK - but seems then to execute as a no op. Since having completed that

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Alan Chandler
On 26/08/10 20:29, Alan Chandler wrote: > On 26/08/10 17:38, Simon Slavin wrote: > >> So someone can check it out. Try it with a VIEW that definitely doesn't >> exist, or use >> >> CREATE VIEW IF NOT EXISTS ... >> > > As far as I can work it out, the statement then prepares OK - but seems > then

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Simon Slavin
On 26 Aug 2010, at 8:29pm, Alan Chandler wrote: > On 26/08/10 17:38, Simon Slavin wrote: > >> So someone can check it out. Try it with a VIEW that definitely doesn't >> exist, or use >> >> CREATE VIEW IF NOT EXISTS ... >> > > As far as I can work it out, the statement then prepares OK -

[sqlite] How to get the original rows after 'group by'?

2010-08-26 Thread Peng Yu
Hi, In the following sql query, I want to get all the lines which satisfies that the first column appears less or equal to 2 times. Is there a way to do it other than using inner join of the original table and the query in main.sql? $ cat main.sql #!/usr/bin/env bash #sqlite3 foods.db

Re: [sqlite] How to get the original rows after 'group by'?

2010-08-26 Thread David Bicking
you can use: select col1, col2 from test where col1 in (select col1 from test group by col1 having count(*)<=2); David --- On Thu, 8/26/10, Peng Yu wrote: > From: Peng Yu > Subject: [sqlite] How to get the original rows after 'group by'? > To:

[sqlite] Error message in RAISE(ABORT,...)

2010-08-26 Thread David Bicking
Can the Error message returned by a trigger be an expression? My testing seems to indicate that you can only put a string literal in the Raise function. What I am trying to do is return the data that the trigger was looking at when it raised the error. My application can insert one to four

Re: [sqlite] How to get the original rows after 'group by'?

2010-08-26 Thread Peng Yu
Hi, Without using sqlite, I can sort the table test ('sort' is from coreutils, sort on the 1st column then the 2nd column), then I use awk to parse the sorted file to get what I need. Should this approach be faster than the sqlite query (in terms of runtime, not in term of programming time)? On

[sqlite] upstreaming Chromium patches for file handle passing support

2010-08-26 Thread Paweł Hajdan , Jr .
Please take a look at chromium_sqlite3 functions in http://src.chromium.org/viewvc/chrome/trunk/src/third_party/sqlite/src/src/os_unix.c?view=markup They are needed because in Chrome the browser process will pass a file descriptor to the child renderer process instead of a file path. Here's the