[sqlite] Check out my photos on Facebook

2009-07-16 Thread Allan Edwards
Hi Sqlite-users, I set up a Facebook profile where I can post my pictures, videos and events and I want to add you as a friend so you can see it. First, you need to join Facebook! Once you join, you can also create your own profile. Thanks, Allan To sign up for Facebook, follow the link

Re: [sqlite] Performance issue on records retrieval :: 100, 000 records

2009-07-16 Thread Simon Slavin
On 16 Jul 2009, at 6:22pm, MADHAVAN VINOD wrote: > Suppose, if I don't have index, is this the desired behavior of Sqlite > to take this much time to fetch just 10 records or am I missing > something here. Your first post states quite clearly '5) No INDEX created.'. Without any index on your

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Gerry Snyder
On Thu, Jul 16, 2009 at 4:20 AM, Michael Schlenker wrote: > > > This is perfectly safe: > set result [db1 eval {select * from X where label = $myStringValue and id > > $compId}] > > But you MUST use {} to quote your query and not "", so sqlite gets to do > the > substitution (or

Re: [sqlite] Performance issue on records retrieval :: 100, 000 records

2009-07-16 Thread Pavel Ivanov
> Suppose, if I don't have index, is this the desired behavior of Sqlite > to take this much time to fetch just 10 records or am I missing > something here. You're missing that SQLite have to fetch all records satisfying your condition into memory storage, sort all these records in memory and

Re: [sqlite] Performance issue on records retrieval :: 100, 000 records

2009-07-16 Thread MADHAVAN VINOD
Hello Michal, Thanks for the reply. Please see my comments inline. >>if you always have condition a=1 (or something similar which uses = for >>comparison) you should have index which starts with this field. The possible values for this field are 1/2. And mostly all the records have the value

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Simon Slavin
On 16 Jul 2009, at 5:31pm, John Machin wrote: > sqlite> create table foo (x, y, z); > sqlite> insert into foo (x, y, x) values ('first', 'second', 'third'); > sqlite> insert into foo values ('first', 'second', 'third'); > sqlite> select * from foo; > first|second| > first|second|third

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread John Machin
On 17/07/2009 1:30 AM, Simon Slavin wrote: > On 16 Jul 2009, at 2:35pm, Uijtdewilligen, Freek wrote: > >> Okay, way too much time after discovering the problem, I found the >> cause: a simple typo :) >> >> In the String where it was storing the column-names, it said (x, y, x, >> etc..), and

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Simon Slavin
On 16 Jul 2009, at 2:35pm, Uijtdewilligen, Freek wrote: > Okay, way too much time after discovering the problem, I found the > cause: a simple typo :) > > In the String where it was storing the column-names, it said (x, y, x, > etc..), and somewhere this created the null.. Congratulations and

[sqlite] Foreign key support

2009-07-16 Thread Lothar Behrens
Hi, I know there is no real support for foreign keys, but I read about the genfkey tool in the shell. This is probably based on the fk tool from Cody Pisto that I am also using. I added support to use the fk source as library in my code to rewrite DDL statements on the

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread John Machin
On 17/07/2009 12:54 AM, Uijtdewilligen, Freek wrote: > >> This sounds like a bug somewhere -- having a column name twice should >> be >> met with an error message, not with setting the integer column to > NULL. >> So please give us some more information: >> >> In the String where it [what is

Re: [sqlite] Performance issue on records retrieval :: 100, 000 records

2009-07-16 Thread Michal Seliga
MADHAVAN VINOD wrote: > > 5) No INDEX created. > > The retrieval logic is such that to retrieve the oldest 10 records along > with some additional constraints (say a, b and c are columns and the > constraints are like a=1 AND b < c). > > > > So my WHERE clause is like "CurrTime <=

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Uijtdewilligen, Freek
> This sounds like a bug somewhere -- having a column name twice should > be > met with an error message, not with setting the integer column to NULL. > > So please give us some more information: > > In the String where it [what is "it"?] was storing the column names > [storing for what

[sqlite] Performance issue on records retrieval :: 100, 000 records

2009-07-16 Thread MADHAVAN VINOD
Hi All, Description of my setup: My database contains 1) One table 2) 20 fields (contains date field to store the inserted time) 3) 100,000 records 4) database size is 21MB. 5) No INDEX created. 6) Sqlite version 3.5.9. The retrieval logic is such that to retrieve

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread John Machin
On 16/07/2009 11:35 PM, Uijtdewilligen, Freek wrote: > Okay, way too much time after discovering the problem, I found the > cause: a simple typo :) > > In the String where it was storing the column-names, it said (x, y, x, > etc..), and somewhere this created the null.. This sounds like a bug

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Uijtdewilligen, Freek
Okay, way too much time after discovering the problem, I found the cause: a simple typo :) In the String where it was storing the column-names, it said (x, y, x, etc..), and somewhere this created the null.. Well, at least I've refreshed my SQL-knowledge, so thank you very much! Greets, Freek

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Adam DeVita
http://unixwiz.net/techtips/sql-injection.html is a nice introduction to sql injection attacks. (Learning by example) It also explains why binding is far superior to trying to invent a set of rules and cleaning the input. . On Thu, Jul 16, 2009 at 9:01 AM, Michael Schlenker

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Uijtdewilligen, Freek
Hey Simon and John, First of all, thanks for the advice! The table has been created using: CREATE TABLE IF NOT EXISTS t_rp (x SMALLINT, y SMALLINT, z SMALLINT, ap SMALLINT, m_id INTEGER PRIMARY KEY) Adding NOT NULL got me an exception when trying to add a 0-coordinate. I also can't use the

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Michael Schlenker
Fredrik Karlsson schrieb: > On Thu, Jul 16, 2009 at 1:20 PM, Michael Schlenker wrote: >> Your working far too hard. The sqlite Tcl binding already does all thats >> needed. >> >> This is perfectly safe: >> set result [db1 eval {select * from X where label = $myStringValue and id

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Fredrik Karlsson
On Thu, Jul 16, 2009 at 1:20 PM, Michael Schlenker wrote: > Your working far too hard. The sqlite Tcl binding already does all thats > needed. > > This is perfectly safe: > set result [db1 eval {select * from X where label = $myStringValue and id > > $compId}] > > But you MUST

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread John Machin
On 16/07/2009 7:24 PM, Uijtdewilligen, Freek wrote: > INSERT INTO t_rp (x, y, z) > VALUES (1, 1, 0); > it gets stored as (1,1,null). What evidence do you have to support your assertion that it is stored as NULL? As Simon has pointed out, 0 != '0'. If after considering that, you feel you

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Michael Schlenker
Fredrik Karlsson schrieb: > Dear list, > > Sorry for jumping onto the list mainly to ask a question, but it is an > imporant one, and I have failed to find the answer on Google. > I am developing a prototype of an application in Tcl using sqlite as > the backend database. Now, I know that I will

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Pavel Ivanov
Does Tcl supports binding of parameters to prepared statement? If yes then do just that and you will not need to do any "quotes" and think of any "ifs". Pavel On Thu, Jul 16, 2009 at 3:49 AM, Fredrik Karlsson wrote: > Dear list, > > Sorry for jumping onto the list mainly to

Re: [sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Simon Slavin
On 16 Jul 2009, at 10:24am, Uijtdewilligen, Freek wrote: > I have used SMALLINT, but the same problem occurred when I > changed it to INTEGER. INTEGER should be correct. Can we see the command you use to make the TABLE t_rp, please ? > When I'm storing a location (x,y,z) into the database

[sqlite] storing and retrieving integers with value 0 (not null)

2009-07-16 Thread Uijtdewilligen, Freek
Hello all, I'm currently using the SQLite database in the Android OS, and running into a problem when I'm trying to store and retrieve location coordinates. I have used SMALLINT, but the same problem occurred when I changed it to INTEGER. When I'm storing a location (x,y,z) into the

Re: [sqlite] Announce of the new "Versioning" extension

2009-07-16 Thread Neville Franks
Hi Alexey, Thank you for the license change and readme. Wednesday, July 15, 2009, 7:16:44 PM, you wrote: AP> Hello! AP> On Wednesday 15 July 2009 09:56:28 Neville Franks wrote: >> Hi Alexey, >> Thank you for this extension which could be quite interesting to many >> SQLite users. Is there any

Re: [sqlite] Compile warnings

2009-07-16 Thread MikeW
D. Richard Hipp writes: ...snip > > Many of the warnings you mention could be suppressed by initializing > some variables. But those initializations are technically unnecessary > and thus slow things down. (Most will probably make no measureable > difference in speed, but an

[sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Fredrik Karlsson
Dear list, Sorry for jumping onto the list mainly to ask a question, but it is an imporant one, and I have failed to find the answer on Google. I am developing a prototype of an application in Tcl using sqlite as the backend database. Now, I know that I will be dealing with quite naïve users,

Re: [sqlite] Do people think of SQLite as a file or as a database

2009-07-16 Thread Yan Bertrand
Same here. For me the fact that it manages quick access to data through indexes - and uses SQL query language - makes it a database of its own right and merits. -Message d'origine- De : sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] De la part de Michal Seliga

Re: [sqlite] Do people think of SQLite as a file or as a database

2009-07-16 Thread Michal Seliga
for me sqlite is database engine. and its files i call databases CadMapper wrote: > This is not a technical question about SQLite. I want to you how people in > general think about SQLite. Is that a file or a database? When you talk > about it, do you refer to it as file or database? > >