Re: [sqlite] FTS3 Question

2008-05-19 Thread Mike Marshall
What I'm trying to do is get the query strings that are stored in category executed against the text stored in data. Category is essentially a fixed set of content, whilst data changes. I could just step through category and execute each query individually, but I was looking for a way to do it in

Re: [sqlite] text datatype and referential integrity

2008-05-19 Thread palmer ristevski
Thanks Barefeet! I thought that it could be done with triggers, but I am knew and had difficult time finding good tutorials on triggers in SQLite. Thanks for your detailed code below. I always saw SQLite as trying to be the database to beat out MS Access for the desktop user. And due to this bel

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Thanks Puneet!!! > > SELECT '_' || startyear || '_' > FROM bsp_options > WHERE startyear LIKE '1990%' > > You results may look like so > > _1990 _ > > Notice the empty space after 1990? > > This was it! The client's csv file had an extra space at the end of the year. I didn't know this be

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
D. Richard Hipp wrote: > On May 19, 2008, at 9:16 PM, Skip Evans wrote: > >> D. Richard Hipp wrote: >>> What does this show: >>> >>>SELECT DISTINCT typeof(startyear) FROM bsp_options; >>>SELECT DISTINCT typeof(endyear) FROM bsp_options; >>> >> I pasted those two statements into the SQL win

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread D. Richard Hipp
On May 19, 2008, at 9:16 PM, Skip Evans wrote: > D. Richard Hipp wrote: >> What does this show: >> >>SELECT DISTINCT typeof(startyear) FROM bsp_options; >>SELECT DISTINCT typeof(endyear) FROM bsp_options; >> > I pasted those two statements into the SQL window > and it returned: > > 2 quer

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread P Kishor
On 5/19/08, Skip Evans <[EMAIL PROTECTED]> wrote: > Hey all, > > Here's the table definition: > > CREATE TABLE bsp_options ( > optionsID INTEGER NOT NULL PRIMARY KEY, > modelID INT(11) NOT NULL, > startyear INT(11) NOT NULL, > endyear INT(11) NOT NULL, > options TEXT NOT NULL, > productcode

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
I'm looking at the data in SQLiteAdmin, where I can just browse and see records that meet the criteria. I can search on modelID=351 to display the records, but then when I add "and startyear=1990 it returns no records, even though I can see with the first query records where this condition is

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Hey all, Here's the table definition: CREATE TABLE bsp_options ( optionsID INTEGER NOT NULL PRIMARY KEY, modelID INT(11) NOT NULL, startyear INT(11) NOT NULL, endyear INT(11) NOT NULL, options TEXT NOT NULL, productcodesize VARCHAR(10), productdesc VARCHAR(200), pattern VARCHAR(10) ); The insert

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread P Kishor
On 5/19/08, Skip Evans <[EMAIL PROTECTED]> wrote: > Even this statement > > SELECT * FROM bsp_options WHERE modelID=351 and > startyear=1990 > > Is returning no rows and I can clearly see dozens > that meet the criteria! If you are not getting rows returned, how can you clearly see dozens of r

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread P Kishor
On 5/19/08, Skip Evans <[EMAIL PROTECTED]> wrote: > What happens if the field in the table is defined > as int(11) but the insert command wraps the values > with single quotes? What do you mean by "insert command wraps the values with single quotes"? You can't wrap values with single quotes in a

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
I don't have access to a command line tool. This server is at a client's hosting facility and I have no shell acess. BareFeet wrote: > Sorry, I left out a dot. It should be: > > .mode insert > select * from bsp_options where modelID=351; > > You enter tat using the command line tool. It will r

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Even this statement SELECT * FROM bsp_options WHERE modelID=351 and startyear=1990 Is returning no rows and I can clearly see dozens that meet the criteria! Here is the table def. I've recreated and repopulated them using int(11) for the year fields: CREATE TABLE bsp_options ( optionsID INTE

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
What happens if the field in the table is defined as int(11) but the insert command wraps the values with single quotes? In MySQL this makes no difference. All the operations still work the same. Is SQLite different? Thanks! Skip -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madi

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
D. Richard Hipp wrote: > What does this show: > > SELECT DISTINCT typeof(startyear) FROM bsp_options; > SELECT DISTINCT typeof(endyear) FROM bsp_options; > I pasted those two statements into the SQL window and it returned: 2 query has been executed. 1.04 msec. 0 Line has been modified.

Re: [sqlite] Help with syntax

2008-05-19 Thread Carlo S. Marcelo
Hey Barefoot, Finally got it to work! I get how the syntax works now, you declare the columns and set values for them :) That's great, I can start creating my script now, 99,997 more entries to go hehe! Cheers! Carlo - Original Message From: BareFeet <[EMAIL PROTECTED]> To: General D

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread D. Richard Hipp
On May 19, 2008, at 9:03 PM, Skip Evans wrote: > Hey D. Richard & all, > > Casting them as int's also did not work. Here's > the schema: > > CREATE TABLE bsp_options > ( > optionsID INTEGER NOT NULL PRIMARY KEY, > modelID INT(11) NOT NULL, > startyear VARCHAR(4) NOT NULL DEFAULT '0', > endyear VA

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread BareFeet
Hi Skip, > I'm not sure what you mean by what is below: >> mode insert >> select * from bsp_options where modelID=351; >> > Is that two separate SQL statements? I'm testing all this using the > SQLiteAdmin tool, so do I paste > what you have above in the SQL window? I tried that and got an >

Re: [sqlite] Help with syntax

2008-05-19 Thread BareFeet
Hi Carlo, > Well those original instructions are correct, as long as you unsmarten > the the quotes, so it reads: > > sqlite /var/local/database/dblist "insert into list > (owner,behavior,entry) values(0,0,'newblacklistentry.com') " I should clarify that I meant the syntax of your original instru

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Hey D. Richard & all, Casting them as int's also did not work. Here's the schema: CREATE TABLE bsp_options ( optionsID INTEGER NOT NULL PRIMARY KEY, modelID INT(11) NOT NULL, startyear VARCHAR(4) NOT NULL DEFAULT '0', endyear VARCHAR(4) NOT NULL DEFAULT '0', options TEXT NOT NULL, productcodesiz

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Hey, I'm not sure what you mean by what is below: BareFeet wrote: > Try this: > > mode insert > select * from bsp_options where modelID=351; > Is that two separate SQL statements? I'm testing all this using the SQLiteAdmin tool, so do I paste what you have above in the SQL window? I tried t

Re: [sqlite] Help with syntax

2008-05-19 Thread Carlo S. Marcelo
From: BareFeet <[EMAIL PROTECTED]> To: General Discussion of SQLite Database Sent: Tuesday, May 20, 2008 8:37:37 AM Subject: Re: [sqlite] Help with syntax Well those original instructions are correct, as long as you unsmarten the the

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Jay A. Kreibich wrote: > > Do you really mean for the years to be string literals and not numbers? > I've tried it both ways to no avail. -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison, WI 53703 608-250-2720 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread D. Richard Hipp
On May 19, 2008, at 8:42 PM, Skip Evans wrote: > Hey all, > > For the life of me I can't figure out why the > following statement returns no rows: > > SELECT productcodesize,options FROM bsp_options > WHERE modelID=351 AND '1990' >= startyear AND > '1990' <= endyear My guess is that you are stor

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread BareFeet
Hi Skip, Try this: mode insert select * from bsp_options where modelID=351; That will show us detail of how the data is stored, such as whether startyear and endyear are stored as text or numeric. If they are stored as numeric, but your query treats them as text, then that's your problem.

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Jay A. Kreibich
On Mon, May 19, 2008 at 07:42:36PM -0500, Skip Evans scratched on the wall: > Hey all, > > For the life of me I can't figure out why the > following statement returns no rows: > > SELECT productcodesize,options FROM bsp_options > WHERE modelID=351 AND '1990' >= startyear AND > '1990' <= endyea

[sqlite] Baffling SQLite statement

2008-05-19 Thread Skip Evans
Hey all, For the life of me I can't figure out why the following statement returns no rows: SELECT productcodesize,options FROM bsp_options WHERE modelID=351 AND '1990' >= startyear AND '1990' <= endyear I'm looking right now at a printout of records from the query: SELECT productcodesize,op

Re: [sqlite] Help with syntax

2008-05-19 Thread BareFeet
Hi Carlo, > Here are the instructions given me > You can add entries with inserts from the command line. You should > be able to do it like this: > > sqlite /var/local/database/dblist “insert into list > (owner,behavior,entry) values(0,0,’newblacklistentry.com’) ” Well those original instru

Re: [sqlite] Help with syntax

2008-05-19 Thread Carlo S. Marcelo
@Igor: That's a good idea, taking the list out of a CVS formatted file and run that command @Barefoot: Here are the instructions given me, which includes the schema you requested: You get the schema of entry with: .schema sqlite> .schema create table list (id integer primary key,owner_id inte

Re: [sqlite] sqlite-users Digest, Vol 5, Issue 47

2008-05-19 Thread P Kishor
You have chosen to reply to a digest post you received, and as a result, I have no idea what thread you are talking about. Please note at least two things -- one, don't hijack threads because they break conversation, digress, distract, and confuse; this includes not replying to digests; and two, yo

Re: [sqlite] Help with syntax

2008-05-19 Thread Igor Tandetnik
Carlo S. Marcelo <[EMAIL PROTECTED]> wrote: > Below is the syntax and error I received. > > [EMAIL PROTECTED] root]# sqlite > /var/local/database/dblist "insert into > list ('0,0,newblacklistentry1,com') values > ('0,0,newblacklistentry1.com')" > SQL error: table list has no column named > 0,0,newb

Re: [sqlite] Help with syntax

2008-05-19 Thread BareFeet
Hi Carlo, > insert into list ('0,0,newblacklistentry1,com') > values ('0,0,newblacklistentry1.com')" > SQL error: table list has no column named 0,0,newblacklistentry1,com Well, the error tells you the problem. You are asking SQLite to insert a text value '0,0,newblacklistentry1.com' into a co

Re: [sqlite] text datatype and referential integrity

2008-05-19 Thread BareFeet
Hi Palmer, >> Say one defines a column to be of text type, but you want only >> 'text' to contain only alphabetic characters, no numeric >> characters, how would one create this rule and enforce it in SQLite >> SQL or does one have to use triggers. > > Perhaps something like this: > > crea

[sqlite] Help with syntax

2008-05-19 Thread Carlo S. Marcelo
Hi! I just subscribed to the mailing list as my work now requires some sqlite stuff. Below is the syntax and error I received. [EMAIL PROTECTED] root]# sqlite /var/local/database/dblist "insert into list ('0,0,newblacklistentry1,com') values ('0,0,newblacklistentry1.com')" SQL error: table lis

Re: [sqlite] Indexing virtual tables

2008-05-19 Thread Scott Hess
It sounds like you're still trying to push your index outside the virtual table. My suggestion was to have your virtual table t internally create a regular SQLite table t_aux (or something of the sort) which replicates the data you want to index from your flat file, and puts an index on it. Then

Re: [sqlite] FTS3 Question

2008-05-19 Thread Scott Hess
Should the 'data' table be joinable with the 'category' table in some way? Are you trying to match rows in 'data' which contain _all_ of the 'query' items from 'category', or which contain _any_ of the 'query' items from 'category'? Do you mean to have a WHERE clause or anything on what you're pu

[sqlite] SQLITE_ENABLE_FTS3

2008-05-19 Thread paul breen
Hello: I want to build sqlite3.dll with fts3 support. I can build the dll but I don't know how to "switch on" or define SQLITE_ENABLE_FTS3. Obviously, I am not a c programmer, I just want the dll for powerbasic. Here is what I have: I have visual studio 2005. console project set.

Re: [sqlite] SQLite remote management tools?

2008-05-19 Thread Derek Developer
We are in Beta with a windows tool: The RemSQL Library consists of standard dynamic link libraries (DLLs) that can be used in a wide variety of programming languages. Because most programming languages support calling functions exported from a DLL, the Library Edition provides the broadest com

Re: [sqlite] SQLite : text datatype and referential integrity

2008-05-19 Thread palmer ristevski
Igor, Thanks once again for your quick response. Sincerely, Palmer > To: sqlite-users@sqlite.org > From: [EMAIL PROTECTED] > Date: Mon, 19 May 2008 13:54:48 -0400 > Subject: Re: [sqlite] SQLite : text datatype and referential integrity > > palmer ristevski <[EMAIL PROTECTED]> > wrote: > > At f

Re: [sqlite] SQLite : text datatype and referential integrity

2008-05-19 Thread Igor Tandetnik
palmer ristevski <[EMAIL PROTECTED]> wrote: > At first I thought that LTRIM you were refering to VB6, > but then I noticed this is in a Create Table statement which then > implied to me SQL stuff. > I did a search and found that LTRIM is also a SQLite > function/expression. Now is the expression 'c

Re: [sqlite] SQLite : text datatype and referential integrity

2008-05-19 Thread palmer ristevski
Thanks Igor! At first I thought that LTRIM you were refering to VB6, but then I noticed this is in a Create Table statement which then implied to me SQL stuff. I did a search and found that LTRIM is also a SQLite function/expression. Now is the expression 'check' also some predefined function in

Re: [sqlite] sqlite3_mprintf() best practice

2008-05-19 Thread Igor Tandetnik
Aladdin Lampé <[EMAIL PROTECTED]> wrote: > What's the recommended usage and best practice for this function? It's best not to use it at all, but instead use a parameterized query and bind the user-provided untrusted string as a parameter. Igor Tandetnik __

Re: [sqlite] SQLite : text datatype and referential integrity

2008-05-19 Thread Igor Tandetnik
palmer ristevski <[EMAIL PROTECTED]> wrote: > Say one defines a column to be of text type, > but you want only 'text' to contain only alphabetic characters, > no numeric characters, how would one create this rule and enforce it > in SQLite SQL or does one have to use triggers. Perhaps something

[sqlite] SEGFAULT using 3.5.9 reproducible!

2008-05-19 Thread Ken
Ticket 3127 created. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] design question / discussion

2008-05-19 Thread Ken
Rich, >From your design it appears you are writing to a seperate db while a >"download" is happening? I'm guessing that is to prevent a read/write lock >contention correct? It seems to me that any new data coming in will need to write and you are simply looking to read during a download operat

[sqlite] FW: SQLite : text datatype and referential integrity

2008-05-19 Thread palmer ristevski
From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: SQLite : text datatype and referential integrity Date: Sat, 17 May 2008 17:09:25 + Hi, Say one defines a column to be of text type, but you want only 'text' to contain only alphabetic characters, no numeric characters, how woul

[sqlite] sqlite3Atoi64() and input string "0"

2008-05-19 Thread Aladdin Lampé
Hi! Just wanted to say that the sqlite3Atoi64() function doesn't seem to work properly when zNum = "0", because the while( zNum[0]=='0' ){ zNum++; } skips it, leading to an empty string and i == 0. Then, the test "if( c!=0 || i==0 || i>19 )" always return 0 (false), meaning that the conversion

[sqlite] sqlite3_mprintf() best practice

2008-05-19 Thread Aladdin Lampé
Peeking at the SQLite source code, I see different usage pattern or the sqlite3_mprintf() function: - sqlite3_mprintf("direct static string without %"); - sqlite3_mprintf("%s", zString); What's the recommended usage and best practice for this function? I think that using the sqlite3_mprintf(zStr

Re: [sqlite] Indexing virtual tables

2008-05-19 Thread Aladdin Lampé
Nobody? Did I make myself clear or do you need more (or maybe less!) explanations? Thanks, Aladdin > From: [EMAIL PROTECTED] > To: sqlite-users@sqlite.org > Date: Sat, 17 May 2008 16:41:49 +0200 > Subject: [sqlite] Indexing virtual tables > > > Hi! Here is what I'm still trying to achieve: > - I

Re: [sqlite] Sqlite3

2008-05-19 Thread P Kishor
On 5/19/08, Hildemaro Carrasquel <[EMAIL PROTECTED]> wrote: > Hello.- > > I want to know, how many connections does Sqlite3 support? SQLite is not a server in a traditional sense. It is the client *and* the server. It is embedded in your application. In that sense, it can support as many connecti

Re: [sqlite] sqlite3_transfer_bindings obsolete?

2008-05-19 Thread Ralf Junker
>> Drat. It doesn't look like there's a way to see what's already been >> bound to a statement either, correct? See this thread for a previous disuccsion of the problem: http://www.mail-archive.com/sqlite-users@sqlite.org/msg28610.html Ralf ___ sql

[sqlite] Sqlite3

2008-05-19 Thread Hildemaro Carrasquel
Hello.- I want to know, how many connections does Sqlite3 support? -- Ing. Hildemaro Carrasquel Ingeniero de Proyectos Cel.: 04164388917/04121832139 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/s