Re: [sqlite] .separator \t not working

2008-07-23 Thread Schplurtz le déboulonné
Hello, Le 24 juil. 08 à 01:28, none given a écrit : > I then attempt the 3 variations of the statement as such : > sqlite3 test.db ".separator '\t' .import data.csv wc2" > sqlite3 test.db ".separator \t .import data.csv wc2" > sqlite3 test.db ".separator '\t' \n .import data.csv wc2" [snip] >

[sqlite] .separator \t not working

2008-07-23 Thread none given
Hi, I am having issues running an import from the command line (on a Mac). When running: sqlite3 separator '\t' test.db ".import data.csv wc2" I get the error : line 1: expected 27 columns of data but found 1 (the file and the table structure both exist). I then attempt the 3 variations of

Re: [sqlite] FTS index size

2008-07-23 Thread Scott Hess
OK! This gives me something I can sink my teeth into! I hacked together a TCL script which takes info about 100 albums (snagged from a list on the Internet), makes up 10 song titles each, makes up a path in the obvious way, and stuffs them into a table. Then it times SELECT COUNT(*). Three

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Griggs, Donald
Regarding: If you can't upgrade you simply need to calculate the length as well. ... then substr(artist, 5, length(artist)-4) Am I right that it's ok to simply specify a large value for the third parameter? SQLite version 3.3.12 select substr('The Quick Brown Fox', 5, 999);

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
Dennis Cote wrote: > Andrew Gatt wrote: > >> Error: wrong number of arguments to function substr() >> >> I'm using sqlite 3.3.6, but i'm presuming the two and three variable >> substr functions go back further than this? Doing tests it seems to be >> the two variable version it doesn't like.

Re: [sqlite] problem building reduced-size sqlite

2008-07-23 Thread Dennis Cote
Shane Harrelson wrote: > I checked in some updates to the "configure" support that will hopefully do > the right thing and pass any OMIT options to lemon and mkkeywordhash. > There was also a minor fix to handle SQLITE_OMIT_VIEW being defined while > SQLITE_OMIT_SUBQUERY is undefined in select.c

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Dennis Cote
Andrew Gatt wrote: > > Error: wrong number of arguments to function substr() > > I'm using sqlite 3.3.6, but i'm presuming the two and three variable > substr functions go back further than this? Doing tests it seems to be > the two variable version it doesn't like. Do i need to upgrade my

Re: [sqlite] sqlite 3.5.8 database corruption

2008-07-23 Thread Brad House
D. Richard Hipp wrote: > On Jul 23, 2008, at 1:08 PM, Brad House wrote: > >> I'm just investigating an issue now. This is the first ever >> incident of a corrupt database we've had on a few thousand >> installations, > > Have you read the background information at > >

Re: [sqlite] Ignoring "The"

2008-07-23 Thread David Bicking
On Wed, 2008-07-23 at 12:30 -0400, Igor Tandetnik wrote: > Dennis Cote <[EMAIL PROTECTED]> wrote: > > Andrew Gatt wrote: > >> I have a table of music artist names which i'd like to output in > >> order. Normally i just use: > >> > >> select * from artists order by artist_name; > >> > >> What i'd

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
Dennis Cote wrote: > Andrew Gatt wrote: > >> I have a table of music artist names which i'd like to output in order. >> Normally i just use: >> >> select * from artists order by artist_name; >> >> What i'd really like to do is order the artists by name but ignore any >> "the" or "the,"

Re: [sqlite] sqlite 3.5.8 database corruption

2008-07-23 Thread D. Richard Hipp
On Jul 23, 2008, at 1:08 PM, Brad House wrote: > I'm just investigating an issue now. This is the first ever > incident of a corrupt database we've had on a few thousand > installations, Have you read the background information at http://www.sqlite.org/atomiccommit.html See especially

Re: [sqlite] sqlite 3.5.8 database corruption

2008-07-23 Thread Brad House
Guess the mailing list stripped the attachment, I've uploaded it here: http://www.monetra.com/~brad/integrity_check.txt.bz2 Brad House wrote: > I'm just investigating an issue now. This is the first ever > incident of a corrupt database we've had on a few thousand > installations, though most of

[sqlite] sqlite 3.5.8 database corruption

2008-07-23 Thread Brad House
I'm just investigating an issue now. This is the first ever incident of a corrupt database we've had on a few thousand installations, though most of our installations are on SQLite 3.4, our latest release is now using 3.5.8. We have deployments on just about every OS... The OS that experienced

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Dennis Cote
Igor Tandetnik wrote: > > Only change the order of the tests - test for 'the,' (with comma) first, > otherwise you'll never get to it. > Yes, of course. Thats what happens every time I post untested code. I should know better by now. :-) Dennis Cote

Re: [sqlite] SQLite under c++

2008-07-23 Thread Igor Tandetnik
Juzbrig <[EMAIL PROTECTED]> wrote: > I am new in sqlite (before I have mysql + php experience). I have a > question If my DB is alredy open > > sqlite3* handle; > const char* baza = "cols.db3" ; > char *zErrMsg = 0; > sqlite3_open(test_baza,); > > How can I get the results of SQL "SELECT * FROM"

Re: [sqlite] Cursors in SQlite

2008-07-23 Thread Brown, Daniel
Thanks Igor, It occurred to me that sqlite3_step is similar to a cursor about thirty minutes after I sent my email, while I was driving home. That article was very interesting; in our current custom database solution we have cursors but the rest of our solution is so limited compared to SQLite I

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Igor Tandetnik
Dennis Cote <[EMAIL PROTECTED]> wrote: > Andrew Gatt wrote: >> I have a table of music artist names which i'd like to output in >> order. Normally i just use: >> >> select * from artists order by artist_name; >> >> What i'd really like to do is order the artists by name but ignore >> any "the" or

Re: [sqlite] FTS index size

2008-07-23 Thread Jiri Hajek
> Again, you've given a relatively broad description of what you're > trying to do. I could make up a bunch of stuff and answer my own > question, but you'd probably rather than I considered the problem > _you_ are having. Ok, I'll try to be as specific as possible. The main table I have is (the

Re: [sqlite] Transaction Files / SQLite?

2008-07-23 Thread Sherief N. Farouk
I looked into that, and there seems to be one problem: How to expand the size of a blob? A write won't expand it, according to (my understanding) of the docs. - Sherief > -Original Message- > From: [EMAIL PROTECTED] [mailto:sqlite-users- > [EMAIL PROTECTED] On Behalf Of Dennis Cote >

Re: [sqlite] Transaction Files / SQLite?

2008-07-23 Thread Dennis Cote
Sherief N. Farouk wrote: > > Streams are parallel 'bags of bytes' of a file. As in, you can > open("x.txt"). or open("x.txt:SomeStream"). Or open > ("x.txt:SomeOtherStream"). When you copy x.txt, the streams get copied with > it (assuming, of course, the destination filesystem is NTFS). > > TxF

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Greg Morphis
Could you do something like select title from foo order by replace(title, 'The ', ''); ?? Or add a order_by column On Wed, Jul 23, 2008 at 8:49 AM, Sherief N. Farouk <[EMAIL PROTECTED]> wrote: > Can you define a custom less-than operator for sorting? If this were C++, > I'd do

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Dennis Cote
Andrew Gatt wrote: > I have a table of music artist names which i'd like to output in order. > Normally i just use: > > select * from artists order by artist_name; > > What i'd really like to do is order the artists by name but ignore any > "the" or "the," preceding it. > You could try

Re: [sqlite] error:unable to open database file

2008-07-23 Thread Dennis Cote
kriscbe wrote: > > i am getting new problem while executing my sqlite3 using c++ after some no > of operations on db file > i t gives error "unable to open database file" > This is probably another case of a misleading error message. SQLite may be trying to open a temporary file, not your

Re: [sqlite] Transaction Files / SQLite?

2008-07-23 Thread Sherief N. Farouk
In a nutshell: Streams are parallel 'bags of bytes' of a file. As in, you can open("x.txt"). or open("x.txt:SomeStream"). Or open ("x.txt:SomeOtherStream"). When you copy x.txt, the streams get copied with it (assuming, of course, the destination filesystem is NTFS). TxF is simple: modifications

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Sherief N. Farouk
Can you define a custom less-than operator for sorting? If this were C++, I'd do std::sort(Result.begin(), Results.end(), MyCustomOperator()); - Sherief > -Original Message- > From: [EMAIL PROTECTED] [mailto:sqlite-users- > [EMAIL PROTECTED] On Behalf Of Andrew Gatt > Sent: Wednesday,

Re: [sqlite] Transaction Files / SQLite?

2008-07-23 Thread Dennis Cote
Sherief N. Farouk wrote: > I'm currently trying to port an application that does a lot of work based on > two NTFS features: Streams, and Transactional NTFS. Since TxF is a HUGE > feature, with a lot of potential pitfalls, I thought I might do this as a > layer over SQLite: a db file with one

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
>> I have a table of music artist names which i'd like to output in order. >> Normally i just use: >> >> select * from artists order by artist_name; >> >> What i'd really like to do is order the artists by name but ignore any >> "the" or "the," preceding it. >> >> Any ideas? >> >> Thanks >> >>

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Daniel van Ham Colchete
Andrew Gatt wrote: > I have a table of music artist names which i'd like to output in order. > Normally i just use: > > select * from artists order by artist_name; > > What i'd really like to do is order the artists by name but ignore any > "the" or "the," preceding it. > > Any ideas? > > Thanks

[sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
I have a table of music artist names which i'd like to output in order. Normally i just use: select * from artists order by artist_name; What i'd really like to do is order the artists by name but ignore any "the" or "the," preceding it. Any ideas? Thanks Andrew

Re: [sqlite] SQLite under c++

2008-07-23 Thread Mike Marshall
Do something like this sqlite3_stmt* pStatement; vector vResults; int nError = sqlite3_prepare_v2(pHandle,"SELECT col1 FROM table",-1,,NULL); while (sqlite3_step(pStatement) == SQLITE_ROW) { vResults.push_back((char*)sqlite3_column_text(pStatement, 0)); }

[sqlite] SQLite under c++

2008-07-23 Thread Juzbrig
Hi. I am new in sqlite (before I have mysql + php experience). I have a question If my DB is alredy open sqlite3* handle; const char* baza = "cols.db3" ; char *zErrMsg = 0; sqlite3_open(test_baza,); How can I get the results of SQL "SELECT * FROM" into a string table or any c++ structure ?

Re: [sqlite] How to emulate generate_series function?

2008-07-23 Thread Alexey Pechnikov
В сообщении от Wednesday 23 July 2008 15:42:04 Igor Tandetnik написал(а): > "Alexey Pechnikov" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] > > > select * from direction_telephony > > where prefix in > > ('78312604812','7831260481','783126048','78312604','7831260','783126','78 >

Re: [sqlite] How to emulate generate_series function?

2008-07-23 Thread Russell Leighton
I think you are asking about 'table functions', which are functions that return a rowset and are used in place of a table to generate rows. See: http://www.postgresql.org/docs/7.3/static/xfunc-tablefunctions.html To my knowledge this is not supported in sqlite, except perhaps via virtual

Re: [sqlite] How to emulate generate_series function?

2008-07-23 Thread Igor Tandetnik
"Alexey Pechnikov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > select * from direction_telephony > where prefix in > ('78312604812','7831260481','783126048','78312604','7831260','783126','78312','7831','783','78','7') > order by length(prefix) desc > limit 1; select * from

[sqlite] error:unable to open database file

2008-07-23 Thread kriscbe
hi everyone, i am getting new problem while executing my sqlite3 using c++ after some no of operations on db file i t gives error "unable to open database file" actually my application is every time update a class members and write in to DB once and read the updated field from DB. it is done

[sqlite] How to emulate generate_series function?

2008-07-23 Thread Alexey Pechnikov
Hello! How can I emulate PostreSQL function select generate_series? == Example: select generate_series(1,7); 1 2 3 4 5 6 7 == My task is this: create table direction_telephony ( group_name text not null, name text not null, class text not null, prefix text not null,

[sqlite] request for information

2008-07-23 Thread Cariotoglou Mike
Hi all, and DRH : I am the author of sqlite3Explorer, a windows Gui management tool. One of the users of this program has contacted me wrt to supporting encrypted databases. in the past, Sqlite3Explorer has supported encrypted databases (version 2 of sqlite), even though I do not own a copy of

[sqlite] Transaction Files / SQLite?

2008-07-23 Thread Sherief N. Farouk
I'm currently trying to port an application that does a lot of work based on two NTFS features: Streams, and Transactional NTFS. Since TxF is a HUGE feature, with a lot of potential pitfalls, I thought I might do this as a layer over SQLite: a db file with one table, multiple rows: one for each