Re: [sqlite] Read-only media

2012-09-06 Thread Baruch Burstein
On Thu, Sep 6, 2012 at 5:26 PM, Simon Slavin wrote: > > On 6 Sep 2012, at 3:13pm, Richard Hipp wrote: > > > If the last writer to the database file crashed and left a hot > > journalthen the > > next

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Arbol One
Is this a tricky question? int sqlite3_step(sqlite3_stmt*); -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Richardson Sent: Thursday, September 06, 2012 12:21 PM To: General Discussion of SQLite Database Subject: Re:

Re: [sqlite] How to determine the effective cache size

2012-09-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28/08/12 12:48, Foster, Kristina (CIV) wrote: > Thank you for the clarification. I was wondering if I missed something > with the command line or Python interface. I will stay tuned for the > sqlite3_db_status method in future releases. A new

Re: [sqlite] bus errror on sparc machines

2012-09-06 Thread Richard Hipp
On Thu, Sep 6, 2012 at 1:02 PM, Tal Tabakman wrote: > Hi Guys, > I get a bus error while running a sqlite based app on sparc machine (64 > bits mode) > > here is my stack trace , > > 74ab2dec sqlite3_set_authorizer + 505c > 74adb8cc

[sqlite] bus errror on sparc machines

2012-09-06 Thread Tal Tabakman
Hi Guys, I get a bus error while running a sqlite based app on sparc machine (64 bits mode) here is my stack trace , 74ab2dec sqlite3_set_authorizer + 505c 74adb8cc sqlite3_vtab_config + 99c0 74adc184 sqlite3_vtab_config + a278 74add0f4

[sqlite] offset from matchinfo

2012-09-06 Thread E. Timothy Uy
Hi, it doesn't look like it is possible to get offset information from matchinfo. Is that right? It seems like matchinfo should be the uber set of data for matching. Sometimes early occurrence of a match may mean more significance. Thanks, Tim ___

Re: [sqlite] EXT : C++ - WHERE clause - update

2012-09-06 Thread Black, Michael (IS)
You need to : cout << this->SQLStatement.c_str() << endl; Then put that SQL into the sqlite3 shell against your database and ensure you actually get rows back. You also need to be sure you're looking at the same database. Many times people have multiple copies and the one the program uses is

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Igor Tandetnik
On 9/6/2012 12:14 PM, Arbol One wrote: rc = sqlite3_step(mystmt); if(rc == SQLITE_ROW ) { The code, in this case, does not process this statement!!?? It's possible that no row actually matches the condition, so sqlite3_step returns SQLITE_DONE on the first call. -- Igor Tandetnik

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Rob Richardson
What is the value returned from sqlite3_step()? RobR -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Arbol One Sent: Thursday, September 06, 2012 12:14 PM To: 'General Discussion of SQLite Database' Subject: [sqlite] C++ -

[sqlite] C++ - WHERE clause - update

2012-09-06 Thread Arbol One
rc = sqlite3_step(mystmt); if(rc == SQLITE_ROW ) { The code, in this case, does not process this statement!!?? <<-- apstr = (const char*)sqlite3_column_text(mystmt,pos); std::cout << apstr << std::endl; //<<-- this is not executed } Table: id | tile | fname | mname | lname |

Re: [sqlite] Read-only media

2012-09-06 Thread Simon Slavin
On 6 Sep 2012, at 3:40pm, Richard Hipp wrote: > When SQLITE_OPEN_READONLY is used, then the file might as well be on CDROM > as far as SQLite is concerned. It won't write to it. Even to rollback a > hot journal. Thanks. That makes sense. Simon.

Re: [sqlite] classic update join question

2012-09-06 Thread Jim Morris
This analysis is a good candidate for inclusion in a FAQ or similar document. On 9/5/2012 7:28 PM, Keith Medcalf wrote: sqlite> create table alpha (frequency, term); sqlite> create table beta (term, frequency); sqlite> create index betaterm on beta(term); sqlite> .explain sqlite> explain query

Re: [sqlite] Read-only media

2012-09-06 Thread Richard Hipp
On Thu, Sep 6, 2012 at 10:26 AM, Simon Slavin wrote: > > On 6 Sep 2012, at 3:13pm, Richard Hipp wrote: > > Suppose you open a database in read-only mode (using SQLITE_OPEN_READONLY) > and SQLite finds a hot journal for it. Is tidying up the hot journal

Re: [sqlite] Read-only media

2012-09-06 Thread Simon Slavin
On 6 Sep 2012, at 3:13pm, Richard Hipp wrote: > If the last writer to the database file crashed and left a hot > journalthen the > next reader to come along must rollback that journal before it can > start reading, and that

Re: [sqlite] Read-only media

2012-09-06 Thread Richard Hipp
On Thu, Sep 6, 2012 at 9:39 AM, Baruch Burstein wrote: > Can sqlite databases be read from a read-only media? I seem to remember > seeing something about this on the website, but can't find it. > Usually. If the last writer to the database file crashed and left a hot

Re: [sqlite] Read-only media

2012-09-06 Thread Keith Medcalf
> Can sqlite databases be read from a read-only media? I seem to remember > seeing something about this on the website, but can't find it. Adding on to Michael's reply, you may need to ensure that you have a writeable location for the temp_store depending on what queries you issue.

Re: [sqlite] Read-only media

2012-09-06 Thread Black, Michael (IS)
'twould appear so...the shell even knows about a read-only database. $ sqlite3 test.db SQLite version 3.7.9 2011-11-01 00:52:41 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table test(a,b); sqlite> insert into table values(1,2); Error: near "table":

[sqlite] Read-only media

2012-09-06 Thread Baruch Burstein
Can sqlite databases be read from a read-only media? I seem to remember seeing something about this on the website, but can't find it. -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Black, Michael (IS)
Yeah -- I should've been in a better teaching mode Trying to keep things simple opens up these type of security problemsthough there are lots of situations where this works just fine and is no problem at all (e.g. when you don't have user input or it's completely under your own control

Re: [sqlite] classic update join question

2012-09-06 Thread Rob Richardson
Many thanks to all of you who took the time to correct my misunderstanding of basic SQL. I ran a little test in PostgreSQL (which is the quickest thing I have to play with), and of course, you are all correct and the query does work as designed. I was trying to figure out how to think about

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Richard Hipp
On Thu, Sep 6, 2012 at 7:52 AM, Black, Michael (IS) wrote: > And, when you have problems, you should always examine your SQL by running > the EXACT same string you generate in your program through the sqlite3 > shell. This will help you to figure out if your SQL is wrong

Re: [sqlite] indexing for integer column

2012-09-06 Thread Durga D
Thank you Kees. On Thu, Sep 6, 2012 at 3:34 PM, Kees Nuyt wrote: > On Thu, 6 Sep 2012 12:02:03 +0400, Durga D wrote: > > >Hi All, > > > >Somehow "original author" missed one INTETER column as searchable > >field ( like unique or primary key) in the

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Black, Michael (IS)
And, when you have problems, you should always examine your SQL by running the EXACT same string you generate in your program through the sqlite3 shell. This will help you to figure out if your SQL is wrong or your C++ is wrong. For example even just your SELECT portion generates the wrong

Re: [sqlite] indexing for integer column

2012-09-06 Thread Kees Nuyt
On Thu, 6 Sep 2012 12:02:03 +0400, Durga D wrote: >Hi All, > >Somehow "original author" missed one INTETER column as searchable >field ( like unique or primary key) in the table. When execute queries >based on this integer field in where clause/joins, huge performance

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Stephan Beal
On Thu, Sep 6, 2012 at 10:18 AM, Arbol One wrote: > As many of you know, I am trying to learn SQL using C++. > FWIW: it's much easier to learn SQL in its "native environment" (e.g. by using the sqlite shell app) and then apply that learning to your programming language of

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Baruch Burstein
VALUES is used for INSERTing into a table, not for SELECTing. This is not valid SQL (I would help you fix it, but I can't figure out what you were trying to achieve.) Here is a great reference: http://sqlite.org/lang_select.html On Thu, Sep 6, 2012 at 11:18 AM, Arbol One

[sqlite] C++ - WHERE clause

2012-09-06 Thread Arbol One
As many of you know, I am trying to learn SQL using C++. Below is an error I get when I try using the C++ example below it. Error Code: 1 Error Message: near "VALUES": syntax error Glib::ustring apstr; Glib::ustring sName; int

[sqlite] indexing for integer column

2012-09-06 Thread Durga D
Hi All, Somehow "original author" missed one INTETER column as searchable field ( like unique or primary key) in the table. When execute queries based on this integer field in where clause/joins, huge performance hit. So, I am planning to add INDEXING for this integer column. Is there