Re: [sqlite] Search all collumns with LIKE at once

2007-02-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 fangles wrote: > I'm currently searching through all columns in a table to see if any match > the search text and the query is rather cumbersome. Have you considered http://www.sqlite.org/cvstrac/wiki?p=FtsTwo Roger -BEGIN PGP SIGNATURE-

RE: [sqlite] What is wrong with this SELECT CASE statement?

2007-02-18 Thread RB Smissaert
Thanks. Yes, it will return the errors, but this fell away in my wrapper function. Understand now how this works and will fix it and see how it compares to the Other methods. RBS -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: 19 February 2007 01:42 To:

RE: [sqlite] Re: What is wrong with this SELECT CASE statement?

2007-02-18 Thread RB Smissaert
Thanks, I understand now. Will fix it and see how it compares the other methods. RBS -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: 19 February 2007 04:54 To: SQLite Subject: [sqlite] Re: What is wrong with this SELECT CASE statement? RB Smissaert <[EMAIL

Re: [sqlite] Search all collumns with LIKE at once

2007-02-18 Thread Martin Jenkins
fangles wrote: I'm currently searching through all columns in a table to see if any match the search text and the query is rather cumbersome. Is there a way to use a loop to go through all available columns by some means? Maybe a loop by querying the schema? If you had a PK on that table and

Re: [sqlite] Search all collumns with LIKE at once

2007-02-18 Thread Martin Jenkins
fangles wrote: I'm currently searching through all columns in a table to see if any match the search text and the query is rather cumbersome. Is there a way to use a loop to go through all available columns by some means? Maybe a loop by querying the schema? SELECT * FROM addresses WHERE title

[sqlite] Search all collumns with LIKE at once

2007-02-18 Thread fangles
I'm currently searching through all columns in a table to see if any match the search text and the query is rather cumbersome. Is there a way to use a loop to go through all available columns by some means? Maybe a loop by querying the schema? SELECT * FROM addresses WHERE title LIKE '% +

Re: [sqlite] Binary data in SQLite3

2007-02-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 jose isaias cabrera wrote: > Can SQLite3 save binary data? http://sqlite.org/datatype3.html Look for blobs. > I would like to save zip files on it. Is > this possible? Yes. There is a limit of 2GB per item and there is no random access api to

Re: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread Martin Jenkins
RB Smissaert wrote: Analyzing the lookup table knocks the time down from 0.36 to 0.31 secs, something I didn't expect. That shows the importance of testing. I ported the SQLite benchmarks to Python and was surprised to see some of the tests taking minutes to run versus a few (or a few tens

Re: [sqlite] Binary data in SQLite3

2007-02-18 Thread P Kishor
On 2/19/07, jose isaias cabrera <[EMAIL PROTECTED]> wrote: Greetings! Can SQLite3 save binary data? I would like to save zip files on it. Is this possible? If so, is there a place where I can read or get some examples about it? blobs http://www.sqlite.org/datatype3.html -- Puneet

Re: [sqlite] compare open table and attached database table

2007-02-18 Thread fangles
Igor Tandetnik wrote: > > fangles <[EMAIL PROTECTED]> wrote: >> Hello, I am trying to compare a currently opened database table with >> a table from an attached database. Both tables have identical >> structures but the attached table has an extra record. >> >> The first lists records from the

[sqlite] Binary data in SQLite3

2007-02-18 Thread jose isaias cabrera
Greetings! Can SQLite3 save binary data? I would like to save zip files on it. Is this possible? If so, is there a place where I can read or get some examples about it? Thanks. josé - To unsubscribe, send

Re: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread Martin Jenkins
RB Smissaert wrote: Yes, it looks it isn't there. I guess it isn't really SQLite's place to know how to spell this month's name in your locale. It's a presentation issue at the end of the day and a lookup table is a nice easy solution. to update the table and 25000 records takes about a

[sqlite] Re: What is wrong with this SELECT CASE statement?

2007-02-18 Thread Igor Tandetnik
RB Smissaert <[EMAIL PROTECTED]> wrote: Trying to update my mmdd integers to months with a SELECT CASE statement: SELECT CASE (CAST(DATE_OF_BIRTH / 100 AS INTEGER) - CAST(DATE_OF_BIRTH / 1 AS INTEGER) * 100) WHEN 1 THEN UPDATE A2IDC21_J SET DATE_OF_BIRTH = 'January' WHEN 2 THEN UPDATE

[sqlite] Re: compare open table and attached database table

2007-02-18 Thread Igor Tandetnik
fangles <[EMAIL PROTECTED]> wrote: Hello, I am trying to compare a currently opened database table with a table from an attached database. Both tables have identical structures but the attached table has an extra record. The first lists records from the internal table NOT CONTAINED IN the

[sqlite] compare open table and attached database table

2007-02-18 Thread fangles
Hello, I am trying to compare a currently opened database table with a table from an attached database. Both tables have identical structures but the attached table has an extra record. I wanted to do two queries. The first lists records from the internal table NOT CONTAINED IN the attached

Re: [sqlite] sqlite: current_time is off

2007-02-18 Thread Joe Wilson
--- P Kishor <[EMAIL PROTECTED]> wrote: > On 2/18/07, Neil McLeod <[EMAIL PROTECTED]> wrote: > > I just started using SQLite, and it seems my timestamps are all 5 hours > > ahead of time (i.e. "select current_time" gives me 0:47 when it is actually > > 19:47 here). I guess this is GMT. Is there a

Re: [sqlite] What is wrong with this SELECT CASE statement?

2007-02-18 Thread Joe Wilson
--- RB Smissaert <[EMAIL PROTECTED]> wrote: > Trying to update my mmdd integers to months with a SELECT CASE > statement: > > SELECT CASE > (CAST(DATE_OF_BIRTH / 100 AS INTEGER) - CAST(DATE_OF_BIRTH / 1 AS > INTEGER) * 100) > WHEN 1 THEN UPDATE A2IDC21_J SET DATE_OF_BIRTH = 'January' >

[sqlite] What is wrong with this SELECT CASE statement?

2007-02-18 Thread RB Smissaert
Trying to update my mmdd integers to months with a SELECT CASE statement: SELECT CASE (CAST(DATE_OF_BIRTH / 100 AS INTEGER) - CAST(DATE_OF_BIRTH / 1 AS INTEGER) * 100) WHEN 1 THEN UPDATE A2IDC21_J SET DATE_OF_BIRTH = 'January' WHEN 2 THEN UPDATE A2IDC21_J SET DATE_OF_BIRTH = 'February'

Re: [sqlite] sqlite: current_time is off

2007-02-18 Thread P Kishor
On 2/18/07, Neil McLeod <[EMAIL PROTECTED]> wrote: Hello, I just started using SQLite, and it seems my timestamps are all 5 hours ahead of time (i.e. "select current_time" gives me 0:47 when it is actually 19:47 here). I guess this is GMT. Is there a way to adjust the time? I'm on Windows XP,

Re: [sqlite] How do you combine two SQLite databases?

2007-02-18 Thread Neil McLeod
Thanks! That fixed it. Neil On 2/17/07, Kees Nuyt <[EMAIL PROTECTED]> wrote: On Sat, 17 Feb 2007 15:27:25 -0500, you wrote: >Hello, > >I have two SQLite database files, stuff1.db and stuff2.db. Each has three >tables within. I want to combine the two so I have one database file, >stuff.db,

[sqlite] sqlite: current_time is off

2007-02-18 Thread Neil McLeod
Hello, I just started using SQLite, and it seems my timestamps are all 5 hours ahead of time (i.e. "select current_time" gives me 0:47 when it is actually 19:47 here). I guess this is GMT. Is there a way to adjust the time? I'm on Windows XP, and the time is listed correctly in my taskbar.

Re: [sqlite] migrating from mysql

2007-02-18 Thread Mark Richards
Frederick Grim wrote: Howdy all, So I am wondering if anyone has run into this problem. I am trying to move from mysql to sqlite and the unique constraint from primary keys is not allowing me to insert my sql that I dumped from the mysql database. I have a bunch of join tables so I

[sqlite] migrating from mysql

2007-02-18 Thread Frederick Grim
Howdy all, So I am wondering if anyone has run into this problem. I am trying to move from mysql to sqlite and the unique constraint from primary keys is not allowing me to insert my sql that I dumped from the mysql database. I have a bunch of join tables so I really can't set the id

[sqlite] new algorithm for handling INSERT, and .import patch

2007-02-18 Thread Joe Wilson
It does not appear that the recent INSERT checkin speeds up bulk inserts on already populated tables with many indexes: [3643] Add a new algorithm for handling INSERT which reduces fragmentation on a VACUUM http://www.sqlite.org/cvstrac/chngview?cn=3643

RE: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread RB Smissaert
Analyzing the lookup table knocks the time down from 0.36 to 0.31 secs, something I didn't expect. RBS -Original Message- From: RB Smissaert [mailto:[EMAIL PROTECTED] Sent: 18 February 2007 19:59 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Month string from -mm-dd Thanks, I

RE: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread RB Smissaert
Thanks, I thought that would be the reason it wasn't included. Doing a join with a lookup table is very much fast enough, so there is no problem there. Just tried it with substr instead of integer division (starting with mmdd) and they are equally fast. Will now try a big CASE statement, but

Re: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote: > Is it possible with the date-time functions to get the month as a string, so > January etc. from the date in the format -mm-dd? This is difficult to internationalize so I omitted it in my implementation of the date/time functions. You can, of

Re: [sqlite] Does SQLITE support RESEEDing of AUTOINCREMENT fields

2007-02-18 Thread drh
Tom Olson <[EMAIL PROTECTED]> wrote: > Hello, > > Is there a function or PRAGMA that tells the database engine to recalculate > the next sequence number for an AUTOINCREMENT column of a table (i.e. PRAGMA > reseed('tablename')? > You can UPDATE the sqlite_sequence table to do this. -- D.

RE: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread RB Smissaert
Yes, it looks it isn't there. It is no problem though to update the table and 25000 records takes about a third of a second when I do it from the integer mmdd format like this: UPDATE A2IDB3F_J SET DATE_OF_BIRTH = (SELECT MONTH_TEXT FROM MONTH_LOOKUP WHERE (SELECT CAST(DATE_OF_BIRTH / 100 AS

[sqlite] ANN: SQLite ODBC Driver 0.73

2007-02-18 Thread Christian Werner
Hi all, release 0.73 of the SQLite ODBC driver is available for download from http://www.ch-werner.de/sqliteodbc >From the change log: * update to SQLite 3.3.13 * SQLGetInfo(SQL_OWNER_TERM) now is empty string * fixed bug in Win32 version concerning SQLDriverConnect() * added -L/-l/-I/-i

Re: [sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread Martin Jenkins
RB Smissaert wrote: Is it possible with the date-time functions to get the month as a string, so January etc. from the date in the format -mm-dd? Doesn't look like it. Nothing in the wiki and I couldn't see anything in the source either. I suppose you could use a big case statement if you

[sqlite] Does SQLITE support RESEEDing of AUTOINCREMENT fields

2007-02-18 Thread Tom Olson
Hello, Is there a function or PRAGMA that tells the database engine to recalculate the next sequence number for an AUTOINCREMENT column of a table (i.e. PRAGMA reseed('tablename')? Regards, Tom -- View this message in context:

Re: FW: [sqlite] retrieval speedup help requested

2007-02-18 Thread P Kishor
On 2/17/07, Anderson, James H (IT) <[EMAIL PROTECTED]> wrote: Thanks. AFAIK it's not available in sybase, and that's my only sql background. I guessed as much. What ANALYZE does (informal explanation follows) is that it updates all the internal statistics and indexes that SQLite needs for its

[sqlite] Month string from yyyy-mm-dd

2007-02-18 Thread RB Smissaert
Is it possible with the date-time functions to get the month as a string, so January etc. from the date in the format -mm-dd? I can get the month as a number like this: select strftime('%m', '2007-02-17') and I could do a table update by joining to a month lookup table, but I wonder if there

Re: [sqlite] retrieval speedup help requested

2007-02-18 Thread drh
Tom Shaw <[EMAIL PROTECTED]> wrote: > In sqlite 3 I have two tables. city_loc has 156865 entries and > city_block has 1874352 entries: > > CREATE TABLE city_loc (loc_id INTEGER PRIMARY KEY, cc TEXT, region > TEXT, city TEXT, postalCode TEXT, lat REAL, lon REAL, areaCode TEXT); > CREATE TABLE