[sqlite] like operator

2010-12-09 Thread salmaan
Hi i need your help i want a query... i have a question for you suppose i have table name person in that column name description which contains the below words The govt has asked airlines to issue an all-inclusive and reasonable fares in a consumer-friendly manner, something that only Air

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Ryan Johnson
On 12/9/2010 6:46 PM, Simon Slavin wrote: > On 10 Dec 2010, at 12:20am, Ryan Johnson wrote: > >> On 12/9/2010 4:56 PM, Igor Tandetnik wrote: >>> On 12/9/2010 6:42 PM, Ryan Johnson wrote: create table a(x,y INTEGER); >>> This creates a table with column x having no affinity, and column y >>>

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Simon Slavin
On 10 Dec 2010, at 12:20am, Ryan Johnson wrote: > On 12/9/2010 4:56 PM, Igor Tandetnik wrote: >> On 12/9/2010 6:42 PM, Ryan Johnson wrote: >>> create table a(x,y INTEGER); >> This creates a table with column x having no affinity, and column y >> having integer affinity. Is this what you meant? >

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Igor Tandetnik
On 12/9/2010 7:20 PM, Ryan Johnson wrote: > In general, is "1"=1 ever true? With all the talk of dynamic typing, > etc. I would have expected so, but now I wonder... '1'=1 is of course false. But '1'=x, where x is a column having integer affinity and value 1, is true. -- Igor Tandetnik

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Ryan Johnson
On 12/9/2010 4:56 PM, Igor Tandetnik wrote: > On 12/9/2010 6:42 PM, Ryan Johnson wrote: >> create table a(x,y INTEGER); > This creates a table with column x having no affinity, and column y > having integer affinity. Is this what you meant? Doh! That explains why I couldn't repro with only a

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Igor Tandetnik
On 12/9/2010 6:42 PM, Ryan Johnson wrote: > create table a(x,y INTEGER); This creates a table with column x having no affinity, and column y having integer affinity. Is this what you meant? -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Ryan Johnson
On 12/9/2010 4:10 PM, Simon Slavin wrote: > On 9 Dec 2010, at 11:04pm, Ryan Johnson wrote >> I'm a new user to sqlite (I just compiled sqlite-autoconf-3070400 on >> ), and am running into what seems to be a bad interaction between >> type affinity and integer comparisons. >> >> I'm importing

Re: [sqlite] Problem importing integers from csv

2010-12-09 Thread Simon Slavin
On 9 Dec 2010, at 11:04pm, Ryan Johnson wrote: > I'm a new user to sqlite (I just compiled sqlite-autoconf-3070400 on > ), and am running into what seems to be a bad interaction between > type affinity and integer comparisons. > > I'm importing a csv file full of single-digit integer

[sqlite] Problem importing integers from csv

2010-12-09 Thread Ryan Johnson
Hi all, I'm a new user to sqlite (I just compiled sqlite-autoconf-3070400 on cygwin), and am running into what seems to be a bad interaction between type affinity and integer comparisons. I'm importing a csv file full of single-digit integer values into a table which .schema reports as

Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-12-09 Thread Rick Regan
On Tue, Nov 30, 2010 at 12:29 AM, Shane Harrelson wrote: > > I've written two articles about this topic that summarize the problem and how it may be fixed: - http://www.exploringbinary.com/fifteen-digits-dont-round-trip-through-sqlite-reals/ This covers the original

Re: [sqlite] [Bulk] How to optimize this simple select query ?

2010-12-09 Thread Richard Hipp
On Thu, Dec 9, 2010 at 11:27 AM, Vander Clock Stephane < svandercl...@yahoo.fr> wrote: > no one have an idea how to do such query ?? > You can try building with SQLITE_ENABLE_STAT2 and then running ANALYZE. Or, the query you show is ideally suited for the R-Tree module. > > thanks > stéphane

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread luuk34
On 09-12-10 18:53, yazdan asgari wrote: > > --- On Thu, 12/9/10, luuk34 wrote: > > From: luuk34 > Subject: Re: [sqlite] Reading a text file and insert to sqlite tables > To: "General Discussion of SQLite Database" > Date: Thursday,

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread yazdan asgari
Hi Thanks for your quick reply. I saw the linked that you said but my problem is to INSERT data during reading a long text file in which every line consists of several queries. I could read this file and write to an output file but I am not able to write a sqlite command (INSERT in this case)

Re: [sqlite] How to optimize this simple select query ?

2010-12-09 Thread Gerry Snyder
On 12/8/2010 9:56 AM, Vander Clock Stephane wrote: > Hello, > > on the table : > > CREATE TABLE HASH( > ID INTEGER PRIMARY KEY ASC, > x1_y1 INTEGER, > x1_y2 INTEGER, > ... > x5_y5 INTEGER > ); > CREATE INDEX HASH_X1_Y1_IDX ON HASH (X1_Y1); > CREATE INDEX HASH_X2_Y2_IDX ON HASH

Re: [sqlite] How to optimize this simple select query ?

2010-12-09 Thread A.
It seems to me that you may want to consider defining your table as a virtual R* tree based table. See http://www.sqlite.org/rtree.html On Wed, 2010-12-08 at 19:56 +0300, Vander Clock Stephane wrote: > Hello, > > on the table : > > CREATE TABLE HASH( >ID INTEGER PRIMARY KEY ASC, >x1_y1

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread luuk34
On 09-12-10 18:13, yazdan asgari wrote: > Hi > I use C Programming Language and I also know that I could use INSERT command. > But my problem is whether any one could show me a simple code which > demonstrate how an INSERT command should be written during reading a text > file. I have

Re: [sqlite] [Bulk] How to optimize this simple select query ?

2010-12-09 Thread Simon Slavin
On 9 Dec 2010, at 4:27pm, Vander Clock Stephane wrote: > no one have an idea how to do such query ?? I can't solve your problem but I have observations. I don't see how any SGDB (or RDBS as we call them) could do this quickly without lots of indexes. >x3_y2>=<#randomnumber34> and >

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread yazdan asgari
Hi I use C Programming Language and I also know that I could use INSERT command. But my problem is whether any one could show me a simple code which demonstrate how an INSERT command should be written during reading a text file. I have searched Google but I could not find any useful link. 

Re: [sqlite] [Bulk] How to optimize this simple select query ?

2010-12-09 Thread luuk34
On 09-12-10 17:27, Vander Clock Stephane wrote: > no one have an idea how to do such query ?? > > thanks > stéphane > > On 12/8/2010 7:56 PM, Vander Clock Stephane wrote: >> Hello, >> >> on the table : >> >> CREATE TABLE HASH( >> . >> x5_y5>=<#randomnumber73> and >>

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-09 Thread Duquette, William H (316H)
Richard, On 12/8/10 11:44 AM, "Richard Hipp" wrote: On Wed, Dec 8, 2010 at 2:35 PM, Petite Abeille wrote: > Hello, > > The pragma foreign_key_list appears to be deprecated in 3.7.4: > > http://www.sqlite.org/pragma.html#pragma_foreign_key_list > >

Re: [sqlite] [Bulk] How to optimize this simple select query ?

2010-12-09 Thread Vander Clock Stephane
no one have an idea how to do such query ?? thanks stéphane On 12/8/2010 7:56 PM, Vander Clock Stephane wrote: > Hello, > > on the table : > > CREATE TABLE HASH( > ID INTEGER PRIMARY KEY ASC, > x1_y1 INTEGER, > x1_y2 INTEGER, > x1_y3 INTEGER, > x1_y4 INTEGER, > x1_y5

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-09 Thread BareFeetWare
>> The pragma foreign_key_list appears to be deprecated in 3.7.4: Oh no. That is bad news. Please restore this feature. > Now that foreign key constraints are enforced natively, why would you want to > have a list of them? Why should the foreign_key_list pragma continue to > consume code

Re: [sqlite] Selecting a group of entries based on RowID.

2010-12-09 Thread Kees Nuyt
On Wed, 8 Dec 2010 14:25:35 -0800, Kirk Clemons wrote: >Thank you, >I how do I pipe in Windows? I have not had any luck using the pipe command. >I do want to make sure it is going in order so that I have a way of tracking >where it was if it fails. >At first it is just

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread Simon Slavin
On 9 Dec 2010, at 12:33pm, pyt...@bdurham.com wrote: > Simon, > >> convert your text file to .csv format, and use the SQLite command-line tool >> to make a table out of it. > > Will this technique work with multi-line fields (fields with newlines) > or blobs? The answer seems to depend on

Re: [sqlite] What is sqlite3_stmt_readonly for?

2010-12-09 Thread Richard Hipp
On Thu, Dec 9, 2010 at 4:03 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 12/08/2010 11:39 PM, Andy Gibbs wrote: > > It looks like our calls did not go unheeded: it seems now to be fixed > here > >

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread python
Simon, > convert your text file to .csv format, and use the SQLite command-line tool > to make a table out of it. Will this technique work with multi-line fields (fields with newlines) or blobs? Thank you, Malcolm ___ sqlite-users mailing list

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-09 Thread Adam Kennedy
Foreign key information is highly useful in many different ORM systems in many different languages. My personal example, the "An ORM for any SQLite database in one line of code" ORLite module in Perl. http://search.cpan.org/perldoc?ORLite It is expected to generate entire class trees for any

Re: [sqlite] Selecting a group of entries based on RowID.

2010-12-09 Thread Kirk Clemons
Thank you, I how do I pipe in Windows? I have not had any luck using the pipe command. I do want to make sure it is going in order so that I have a way of tracking where it was if it fails. At first it is just going to a TXT file and then I use .import to apply it to the necessary tables. The

[sqlite] Help: Sqlite3 memory leaks & Invalid write errors from valgrind tool

2010-12-09 Thread Borra, Kishore Babu
Hi, It would be very helpful, if you can provide us some info on the below issues (Memory leak & Invalid write errors, found from valgrind tool on Sqlite3 library usage). Executed some Select & Update queries. Don't know if these issue got fixed in the latest sqlite3 library- Sorry for the

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread Simon Slavin
On 9 Dec 2010, at 9:58am, yazdan asgari wrote: > I want to write a program in order to insert data to a sqlite database from a > text file. The text file contains data in each line as below which repeats > about 200 lines: > > P05075 > 01-JAN-1988 > 16 > TOBACCO RATTLE VIRUS (STRAIN PSG). >

Re: [sqlite] WAL index in memory - multiple connections

2010-12-09 Thread Yoni Londner
Hi, Thanks for the quick answer. > Presumably each thread has its own db handle. True. > You could enable shared-cache mode (although that gives you table-level > locking, not the MVCC WAL provides). That is not good enough for me, since I want to run checkpoint in a background thread, while

[sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread yazdan asgari
Dear Friends I want to write a program in order to insert data to a sqlite database from a text file. The text file contains data in each line as below which repeats about 200 lines: P05075 01-JAN-1988 16 TOBACCO RATTLE VIRUS (STRAIN PSG). CORNELISSEN B.J.C., LINTHORST H.J.M., BREDERODE F.T.,

Re: [sqlite] WAL index in memory - multiple connections

2010-12-09 Thread Dan Kennedy
On 12/09/2010 04:08 PM, Yoni Londner wrote: > Hi, > > I want to use the feature that enable WAL to use heap memory instead of > shared memory for WAL index. > Using locking_mode=exclusive is not good enough option, since I want to > access the DB from two threads, and with locking_mode=exclusive I

[sqlite] WAL index in memory - multiple connections

2010-12-09 Thread Yoni Londner
Hi, I want to use the feature that enable WAL to use heap memory instead of shared memory for WAL index. Using locking_mode=exclusive is not good enough option, since I want to access the DB from two threads, and with locking_mode=exclusive I get "database is locked" error. How can I use in

Re: [sqlite] What is sqlite3_stmt_readonly for?

2010-12-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/08/2010 11:39 PM, Andy Gibbs wrote: > It looks like our calls did not go unheeded: it seems now to be fixed here > http://www.sqlite.org/src/info/9c19b7ae35. The question of why the existing authorizer functionality is insufficient or has some