Re: [sqlite] determine SQLITE_MAX_LENGTH or sql_limit/sqlite3_limit

2011-11-14 Thread Kevin Benson
http://www.sqlite.org/limits.html "2.Maximum Number Of Columns The SQLITE_MAX_COLUMN compile-time parameter is used to set an upper bound on: ◦The number of columns in a table ◦The number of columns in an index ◦The number of columns in a view ◦The number of terms in the SET clause of an UPDATE

Re: [sqlite] determine SQLITE_MAX_LENGTH or sql_limit/sqlite3_limit

2011-11-14 Thread vinayh4
Sir , Firstly Thanks for quick reply But actually i need to know about how reset these values ... Is there any file available where we need to edit these values or in command line we need to set these values Please if u can share link or procedure to change these default settings it

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Filip Navara
Hi Alexandr, the mailing list doesn't allow attachments. Please send us the output of "pragma integrity_check;" on the corrupted database file. Also, is the database used in WAL mode? Best regards, Filip Navara 2011/11/14 Alexandr Němec : > Dear all, > > we are using SQLite in

[sqlite] more than 2000 columns

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 7:38am, vinayh4 wrote: > I need to create table with more than 2000 columns, How to reset > SQLITE_MAX_COLUMN value which > is 2000 . Plz help me on this issue. You almost never need to have more columns than you can fit in your head at one time. The way you handle 2000

Re: [sqlite] more than 2000 columns

2011-11-14 Thread vinayh4
Hi Simon In my application a ESB will update more than 2000 columns in simultaneously based on some algorithm processing in real time . So i need to create single table with 2000 columns updated based on result of processing of records. So i need to know how extend no of columns per table

[sqlite] PHP & SQLite examples

2011-11-14 Thread Gert Van Assche
All, I would like to understand how a PHP web page communicates with SQLite. I know something about SQLite, but nothing or not a lot about PHP. I have questions like this: - How does one take input from an input field or a check box and use it for doing an "INSERT" for instance? - How

Re: [sqlite] FTS: Phrase queries

2011-11-14 Thread nobre
Comment from the source: ** TODO: Strangely, it is not possible to associate a column specifier ** with a quoted phrase, only with a single token. Not sure if this was ** an implementation artifact or an intentional decision when fts3 was ** first implemented. Whichever it was, this

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread Stephan Beal
On Mon, Nov 14, 2011 at 11:45 AM, Gert Van Assche wrote: > I would like to understand how a PHP web page communicates with SQLite. I > know something about SQLite, but nothing or not a lot about PHP. I have > questions like this: - How does one take input from an input

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 10:45am, Gert Van Assche wrote: > I would like to understand how a PHP web page communicates with SQLite. All my responses to this are general, with a little hand-waving and simplification. And other posters to this list may have other points of view. I'm just trying to

Re: [sqlite] more than 2000 columns

2011-11-14 Thread Jay A. Kreibich
On Mon, Nov 14, 2011 at 02:41:55AM -0800, vinayh4 scratched on the wall: > > Hi Simon > > In my application a ESB will update more than 2000 columns in > simultaneously based on some algorithm > processing in real time . So i need to create single table with 2000 columns > updated based on

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Alexandr Němec
Dear Filip,   thanks for your reply. I thought that small attachments will go trough. If I run   sqlite3 data.db pragma integrity_check;   I receive this message only:   Error: database disk image is malformed.   Anyway, you can download the database here: http://www.u-consult.cz/db/server.db  

[sqlite] I have a stumper

2011-11-14 Thread Matt Young
Using cv api. I install a prepared statement, but it cannot allow the table identifiers to be replaced with sqlite3_bind. If the table in the statements is a view, then I suppode it is an error to redefine the vie? Bottom line, it is an error to change any table definition in a prepared

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Richard Hipp
2011/11/14 Alexandr Němec > Dear Filip, > > thanks for your reply. I thought that small attachments will go trough. If > I run > > sqlite3 data.db > pragma integrity_check; > > I receive this message only: > > Error: database disk image is malformed. > > Anyway, you can

Re: [sqlite] I have a stumper

2011-11-14 Thread Igor Tandetnik
Matt Young wrote: > I install a prepared statement, but it cannot allow the table identifiers > to be replaced with sqlite3_bind. Of course not. How do you expect SQLite to prepare a query execution plan without knowing which tables it's going to execute against? > If

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Alexandr Němec
Dear Richard,   huh, thanks very much for the information, I see. But anybody having an idea how this can happen? There was a power outage and after restart 6 pages of the database file are missing... We checked the disk carefuly, no bad sector etc. What can be the reason for this?   Thanks

[sqlite] Integrity check reliability

2011-11-14 Thread Verstappen, Jos
Dear SQLite users, Can anyone confirm that the command "PRAGMA integrity_check;" will not crash the SQLite code on a corrupt database? I made a corrupt database on purpose to test, it seems to run ok. The command neatly reports the corruption. But this is just one try. Thank you! Jos This

Re: [sqlite] Integrity check reliability

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 1:19pm, Verstappen, Jos wrote: > Can anyone confirm that the command "PRAGMA integrity_check;" will not > crash the SQLite code on a corrupt database? > I made a corrupt database on purpose to test, it seems to run ok. The > command neatly reports the corruption. But this is

Re: [sqlite] I have a stumper

2011-11-14 Thread Matt Young
SQL needs a create schema, then the statement can be prepared against a know schema, and swap out the table pointer at run time. The problem of one great sql procedure that works on many different table of the same format. I have a work around. ___

[sqlite] OK,OK I have an experiment

2011-11-14 Thread Matt Young
I have table1, I make a view view one of that table. I then delete the table, the view does not work. I then recreate the table, and alter its name to the one viewed. and view suddenly works. Am I dreaming? Does SQLite3 maintain a schema in views an allow us to alter table names? Matt

Re: [sqlite] I have a stumper

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 1:52pm, Matt Young wrote: > SQL needs a create schema, then the statement can be prepared against a > know schema, and swap out the table pointer at run time. The problem of > one great sql procedure that works on many different table of the same > format. > > I have a work

Re: [sqlite] OK,OK I have an experiment

2011-11-14 Thread Igor Tandetnik
Matt Young wrote: > I have table1, I make a view view one of that table. I then delete the > table, the view does not work. > I then recreate the table, and alter its name to the one viewed. > and view suddenly works. > Am I dreaming? Does SQLite3 maintain a schema in

[sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
Hi, a question from a beginner please: SQLITE with WAL mode. If my write transactions consume an average of 10 ticks (1 ticks = 60th of a second), it means that I can get very approximately 6 write operations per second? (with a recent computer powerful enough). At the same time, how many

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Igor Tandetnik
Paxdo Presse wrote: > a question from a beginner please: > > SQLITE with WAL mode. > > If my write transactions consume an average of 10 ticks (1 ticks = 60th of a > second), it means that I can get very approximately > 6 write operations per second? (with a recent computer

[sqlite] Docs on SQLITE_DEFAULT_WAL_AUTOCHECKPOINT

2011-11-14 Thread Black, Michael (IS)
I was looking at this: http://www.sqlite.org/draft/compile.html#default_wal_autocheckpoint And was wondering how to change it. Noticed it's missing the "the compile-time default may be overidden at runtime by the PRAGMA wal_autocheckpoint command". Thought someone might want to update

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
I know it depends on many things. But in your experience, how many write transactions and read transactions could you see at most per second or minute? Very approximately ? with transactions fast enough. Le 14 nov. 2011 à 15:33, Paxdo Presse a écrit : > > Hi, > > a question from a beginner

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Petite Abeille
On Nov 14, 2011, at 3:33 PM, Paxdo Presse wrote: > If my write transactions consume an average of 10 ticks (1 ticks = 60th of a > second), it means that I can get very approximately 6 write operations per > second? (with a recent computer powerful enough). > At the same time, how many read

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
Le 14 nov. 2011 à 15:38, Igor Tandetnik a écrit : > Paxdo Presse wrote: >> a question from a beginner please: >> >> SQLITE with WAL mode. >> >> If my write transactions consume an average of 10 ticks (1 ticks = 60th of a >> second), it means that I can get very approximately

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Igor Tandetnik
Paxdo Presse wrote: > No, I do not know how many "readind threads" SQLITE can handle simultaneously. As many as you want. But recall that your hard drive only has one set of reading heads. Trying to read different parts of the database at once is likely to lead to excessive disk

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Petite Abeille
On Nov 14, 2011, at 3:45 PM, Paxdo Presse wrote: > The writing is sequential, so I guess only one thread at a time. Yes, only one writer at one time. > But for reading? Are multiple threads can "simultaneously" perform read > operations? As many readers as you want.

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Kees Nuyt
On Mon, 14 Nov 2011 14:16:46 +0100, "Alexandr N?mec" wrote: > Dear Richard, >  > huh, thanks very much for the information, I see. > But anybody having an idea how this can happen? > There was a power outage and after restart 6 pages > of the database file are missing... > We

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
Thank you, but the question is not how I can insert records per second. it is for a web application (multiuser, WAL mode). Many threads (connections via internet) can access the database. If each thread writing (a transaction that contains one or more INSERT/UPDATE) takes an average of 10

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Petite Abeille
On Nov 14, 2011, at 3:53 PM, Paxdo Presse wrote: > If each thread writing (a transaction that contains one or more > INSERT/UPDATE) takes an average of 10 ticks, and each thread reading (a > transaction that contains one or more SELECT) takes an average of 10 ticks, I > would like to know how

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
Thanks to both :-) It's not easy to calculate how many simultaneous users the database can handle. Le 14 nov. 2011 à 15:58, Petite Abeille a écrit : > > On Nov 14, 2011, at 3:53 PM, Paxdo Presse wrote: > >> If each thread writing (a transaction that contains one or more >> INSERT/UPDATE)

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 3:05pm, Paxdo Presse wrote: > It's not easy to calculate how many simultaneous users the database can > handle. You are correct. It changes depending on what hard disk the database is stored on, what networking methods you are using, how fast your copy of PHP is running,

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
Thank you. I hesitate a lot in my choice of database for my web application. I guess the use of SSD dramatically increases the performance of SQLite. SQLITE work properly on SSD? Le 14 nov. 2011 à 16:37, Simon Slavin a écrit : > > On 14 Nov 2011, at 3:05pm, Paxdo Presse wrote: > >> It's

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Petite Abeille
On Nov 14, 2011, at 4:49 PM, Paxdo Presse wrote: > I hesitate a lot in my choice of database for my web application. FWIW... Situations Where SQLite Works Well • Websites SQLite usually will work great as the database engine for low to medium traffic websites (which is to say, 99.9% of all

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 3:49pm, Paxdo Presse wrote: > I hesitate a lot in my choice of database for my web application. > I guess the use of SSD dramatically increases the performance of SQLite. > SQLITE work properly on SSD? Yes, there are many users of SQLite using SSD. In fact SQLite is used

Re: [sqlite] Number of transactions per second with WAL mode

2011-11-14 Thread Paxdo Presse
ok, thank you all. Le 14 nov. 2011 à 16:57, Simon Slavin a écrit : > > On 14 Nov 2011, at 3:49pm, Paxdo Presse wrote: > >> I hesitate a lot in my choice of database for my web application. >> I guess the use of SSD dramatically increases the performance of SQLite. >> SQLITE work properly

Re: [sqlite] more than 2000 columns

2011-11-14 Thread Gabor Grothendieck
On Mon, Nov 14, 2011 at 5:32 AM, Simon Slavin wrote: > > On 14 Nov 2011, at 7:38am, vinayh4 wrote: > >> I need to create table with more than 2000 columns, How to reset >> SQLITE_MAX_COLUMN value which >> is  2000 . Plz help me on this issue. > > You almost never need to

Re: [sqlite] more than 2000 columns

2011-11-14 Thread Igor Tandetnik
On 11/14/2011 12:11 PM, Gabor Grothendieck wrote: The requirement for a large number of columns is actually one thing that is often needed when using sqlite from R. Typically the use case is that a user wishes to read a portion of an external file into R and that file has thousands of columns.

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Alexandr Němec
Thanks again for your answer,   no, no dangerous pragmas, no journal file removing. Our file system is NTFS so I hope that no stupid things are done by the file system :). In fact, we changed just two things only in the amalgamation file - we increased SQLITE_MAX_PAGE_COUNT to 2 000 000 000

Re: [sqlite] more than 2000 columns

2011-11-14 Thread Gabor Grothendieck
On Mon, Nov 14, 2011 at 12:21 PM, Igor Tandetnik wrote: > On 11/14/2011 12:11 PM, Gabor Grothendieck wrote: >> >> The requirement for a large number of columns is actually one thing >> that is often needed when using sqlite from R.  Typically the use case >> is that a user

Re: [sqlite] more than 2000 columns

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 5:11pm, Gabor Grothendieck wrote: > The requirement for a large number of columns is actually one thing > that is often needed when using sqlite from R. Typically the use case > is that a user wishes to read a portion of an external file into R and > that file has thousands

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread Dotan Cohen
On Mon, Nov 14, 2011 at 13:43, Simon Slavin wrote: > > On 14 Nov 2011, at 10:45am, Gert Van Assche wrote: > >> I would like to understand how a PHP web page communicates with  SQLite. > > All my responses to this are general, with a little hand-waving and > simplification.  

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread Simon Slavin
On 14 Nov 2011, at 5:53pm, Dotan Cohen wrote: > I recommend against formulating the SQL statements in Javascript. > Because if I find that page, I _will_ try to inject my own SQL. My code on the PHP side executes only the first SQL command. And there a hash. But yes, people should be careful

Re: [sqlite] I have a stumper

2011-11-14 Thread Nico Williams
I thought nowadays SQLite3 was smart enough to re-prepare a prepared statement when the schema changes. Nico -- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] more than 2000 columns

2011-11-14 Thread Gabor Grothendieck
On Mon, Nov 14, 2011 at 12:50 PM, Simon Slavin wrote: > > On 14 Nov 2011, at 5:11pm, Gabor Grothendieck wrote: > >> The requirement for a large number of columns is actually one thing >> that is often needed when using sqlite from R.  Typically the use case >> is that a user

Re: [sqlite] I have a stumper

2011-11-14 Thread Matt Young
I am still learning its behavior. But, my experiment still works, even in embedded. I want lots of procedures working on the same table format, with different table names. So far, I write the procedures using table view. As of right now, I can change the table names using alter table rename and

[sqlite] Custom Column Default

2011-11-14 Thread GGTESTER
Can anybody show me how to use a function like "hex(randomblob(37))" as a column default (to create a SQL Server type unique identifier)? Thanks, Gerhard ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread David Garfield
Please, be correct. There are no secure ways to communicate. Period. Neither "persistent SQL datastores" or "websockets" will get you secure communication. Nor will SSL, or anything else. Paranoia is essential in writing communication software. (Of course, paranoia is important in writing

Re: [sqlite] Custom Column Default

2011-11-14 Thread Jay A. Kreibich
On Mon, Nov 14, 2011 at 12:49:46PM -0600, GGTESTER scratched on the wall: > Can anybody show me how to use a function like > "hex(randomblob(37))" as a column default (to create a SQL Server type > unique identifier)? Expressions much be in parens. Otherwise, just as you would expect:

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Kees Nuyt
On Mon, 14 Nov 2011 18:24:46 +0100, "Alexandr N?mec" wrote: >Thanks again for your answer, >  > no, no dangerous pragmas, no journal file removing. > Our file system is NTFS so I hope that no stupid > things are done by the file system :). In fact, > we changed just two things

Re: [sqlite] 3.7.7.1 database corruption

2011-11-14 Thread Kees Nuyt
On Mon, 14 Nov 2011 21:03:56 +0100, Kees Nuyt wrote: >I can image. Soryy, I have no more ideas. Oops. Make that: I can imagine. Sorry, I have no more ideas. -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list

Re: [sqlite] I have a stumper

2011-11-14 Thread Matt Young
OK,I found the gotcha. I can swap out the target table in a view, but I cannot read the rowids from a view. So, do I have t, are rowids unavailable in a view? > > > On Mon, Nov 14, 2011 at 10:25 AM, Nico Williams wrote: > >> I thought nowadays SQLite3 was smart enough to

Re: [sqlite] I have a stumper

2011-11-14 Thread Igor Tandetnik
On 11/14/2011 5:03 PM, Matt Young wrote: OK,I found the gotcha. I can swap out the target table in a view, but I cannot read the rowids from a view. You can, if you make them part of the view: create view MyView as select rowid, * from MyTable; It might be better though to give an explicit

Re: [sqlite] I have a stumper

2011-11-14 Thread Matt Young
You saved the day! On Mon, Nov 14, 2011 at 2:25 PM, Igor Tandetnik wrote: > On 11/14/2011 5:03 PM, Matt Young wrote: > >> OK,I found the gotcha. I can swap out the target table in a view, but I >> cannot read the rowids from a view. >> > > You can, if you make them part of