[sqlite] having problem in creating new database in MAC OS

2009-08-21 Thread shakeeb khan
Hi, i want to make a database in sqlite using MAC terminal but having problem in creating.kinldy tell me a proper syntax i was trying : sqlitesqlite mydb.db it shows me -- and hault the program kinldy tell me what is a proper way of creating database in sqllite Thanks, -shakeeb

Re: [sqlite] having problem in creating new database in MAC OS

2009-08-21 Thread Igor Tandetnik
shakeeb khan wrote: i want to make a database in sqlite using MAC terminal but having problem in creating.kinldy tell me a proper syntax i was trying : sqlitesqlite mydb.db it shows me -- and hault the program kinldy tell me what is a proper way of creating database in sqllite You first

[sqlite] Date range in the WHERE clause

2009-08-21 Thread Angus March
I have a table where I need to record the date of each insert. Sometime later I'll then delete all rows that were inserted more than 90 days ago. Is it possible to do this w/out performing a table scan? ___ sqlite-users mailing list

Re: [sqlite] having problem in creating new database in MAC OS

2009-08-21 Thread Jean-Denis Muys
On 8/21/09 14:18 , shakeeb khan khanshak...@msn.com wrote: tell me what is a proper way of creating database in sqllite Here is a sample terminal session on my Mac (possibly very poorly reformatted by my mail client): jdmbook:~ klee$ sqlite3 mydb.db SQLite version 3.6.12 Enter .help for

Re: [sqlite] Date range in the WHERE clause

2009-08-21 Thread Igor Tandetnik
Angus March wrote: I have a table where I need to record the date of each insert. Sometime later I'll then delete all rows that were inserted more than 90 days ago. Is it possible to do this w/out performing a table scan? Create an index on the date column. Igor Tandetnik

Re: [sqlite] Date range in the WHERE clause

2009-08-21 Thread Angus March
Igor Tandetnik wrote: Angus March wrote: I have a table where I need to record the date of each insert. Sometime later I'll then delete all rows that were inserted more than 90 days ago. Is it possible to do this w/out performing a table scan? Create an index on the date column.

Re: [sqlite] Date range in the WHERE clause

2009-08-21 Thread Igor Tandetnik
Angus March wrote: Igor Tandetnik wrote: Angus March wrote: I have a table where I need to record the date of each insert. Sometime later I'll then delete all rows that were inserted more than 90 days ago. Is it possible to do this w/out performing a table scan? Create an index on the

Re: [sqlite] Copying an open db file

2009-08-21 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Angus March wrote: I want to copy a db file while it is still open, Have you considered the API specifically designed for this? http://www.sqlite.org/c3ref/backup_finish.html Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux)

Re: [sqlite] Date range in the WHERE clause

2009-08-21 Thread Angus March
Igor Tandetnik wrote: Angus March wrote: Igor Tandetnik wrote: Angus March wrote: I have a table where I need to record the date of each insert. Sometime later I'll then delete all rows that were inserted more than 90 days ago. Is it possible to do this w/out performing a

Re: [sqlite] (no subject)

2009-08-21 Thread Doug
Hi Erick -- I can only help a little with #3. How are your strings stored in your program? If they are stored with wchar_t, then using the '16' APIs is probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc). That's what I do and all sorts of European and Asian customers don't

Re: [sqlite] (no subject)

2009-08-21 Thread Pavel Ivanov
If they are stored with wchar_t, then using the '16' APIs is probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc). Just don't forget that wchar_t on some platforms (reportedly on Linux for example) is 32-bit integer. So conversion between wchar_t and UCS-2 encoding is not

[sqlite] Is rowid sequential?

2009-08-21 Thread John Loveys
Hi All I have an extremely simple little database with one table. I have an embedded app that keeps the database open forever and this table is manipulated by a single thread. I need to make sure this table doesn't get too big - no more than N rows. There is a Start_Time column which holds

Re: [sqlite] Is rowid sequential?

2009-08-21 Thread Kit
2009/8/21 John Loveys john.lov...@nautel.com: Hi All I am hoping the rowid is sequential.  Then I can simply get the biggest rowid (using sqlite3_last_insert_rowid), subtract N from it and delete rows where rowid last_rowid - N.  Can anyone confirm the rowid is guaranteed sequential in my

Re: [sqlite] (no subject)

2009-08-21 Thread Jean-Christophe Deschamps
Hi Pavel, ´¯¯¯ So conversion between wchar_t and UCS-2 encoding is not always as easy as you can think. `--- Is there really anyone using UCS-2 now or did you mean UTF-16? ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] (no subject)

2009-08-21 Thread Pavel Ivanov
Is there really anyone using UCS-2 now or did you mean UTF-16? No, I meant exactly UCS-2. Because UCS-2 guarantees that all symbols are represented by 2 bytes when UTF-16 does not. And I had an understanding that Doug said about this 16-bit guarantee. Also if we're talking about encoding where

Re: [sqlite] (no subject)

2009-08-21 Thread erik
Doug, 3. How are your strings stored in your program?  If they are stored with wchar_t, then using the '16' APIs is probably easiest to use (ie sqlite3_open16, sqlite3_prepare16_v2, etc). I have no idea how they are stored, but I would guess as standard ASCII. Other community members have

[sqlite] DateTime comparison with custom format

2009-08-21 Thread t-master
Hi I have string in a table representing a DateTime. The format is 21.08.2009 00:25:00 And I would like to compare it to now How can I do this? -- View this message in context: http://www.nabble.com/DateTime-comparison-with-custom-format-tp25085040p25085040.html Sent from the SQLite mailing

[sqlite] Reverse string comparison for searches

2009-08-21 Thread Shaun Seckman (Firaxis)
Hello everyone, Currently, in my database I'm storing thousands of strings that are formatted in such a way where they share similar prefixes (i.e. TXT_KEY_FOO, TXT_KEY_BAR). Sadly, this format cannot be changed so I was wondering if it would be possible and perhaps faster to

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread P Kishor
On Fri, Aug 21, 2009 at 1:33 PM, Shaun Seckman (Firaxis)shaun.seck...@firaxis.com wrote: Hello everyone,                Currently, in my database I'm storing thousands of strings that are formatted in such a way where they share similar prefixes (i.e. TXT_KEY_FOO, TXT_KEY_BAR).  Sadly, this

[sqlite] ANN: StepSqlite PL/SQL Compiler for SQLite released

2009-08-21 Thread StepSqlite Team
Hi! Metatranz StepSqlite Team is happy to announce the alpha release of StepSqlite - a powerful, web-based PL/SQL compiler for SQLite. The alpha version is available FREE to try out in your browser at http://www.metatranz.com/stepsqlite Features = 1. Compile Targets: x86 linux and

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Simon Slavin
On 21 Aug 2009, at 7:25pm, t-master wrote: I have string in a table representing a DateTime. The format is 21.08.2009 00:25:00 And I would like to compare it to now How can I do this? If you need to know whether it's before or after instead of just equal, then you're going to need to hold

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread Shaun Seckman (Firaxis)
Unfortunately, not all the prefixes are the same or even the same width, they just all share very similar prefixes. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of P Kishor Sent: Friday, August 21, 2009 2:37 PM To: General

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Igor Tandetnik
t-master t-zimmerm...@onlinehome.de wrote: I have string in a table representing a DateTime. The format is 21.08.2009 00:25:00 I recommend you change the format. Yours is custom-designed to make your life miserable. And I would like to compare it to now select case when substr(T, 7,

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread Igor Tandetnik
Shaun Seckman (Firaxis) shaun.seck...@firaxis.com wrote: Currently, in my database I'm storing thousands of strings that are formatted in such a way where they share similar prefixes (i.e. TXT_KEY_FOO, TXT_KEY_BAR). Sadly, this format cannot be changed so I was wondering if it

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread Shaun Seckman (Firaxis)
This is great! Exactly what I was looking for. Do you by any chance know the function name of the standard collation used for string comparisons? I'd like to use that as a foundation for building a new one. -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread D. Richard Hipp
On Aug 21, 2009, at 2:33 PM, Shaun Seckman (Firaxis) wrote: Currently, in my database I'm storing thousands of strings that are formatted in such a way where they share similar prefixes (i.e. TXT_KEY_FOO, TXT_KEY_BAR). Sadly, this format cannot be changed so I was

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread D. Richard Hipp
On Aug 21, 2009, at 2:49 PM, Shaun Seckman (Firaxis) wrote: This is great! Exactly what I was looking for. Do you by any chance know the function name of the standard collation used for string comparisons? I'd like to use that as a foundation for building a new one. /* ** This is the

Re: [sqlite] Reverse string comparison for searches

2009-08-21 Thread Griggs, Donald
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Shaun Seckman (Firaxis) Sent: Friday, August 21, 2009 2:33 PM To: General Discussion of SQLite Database Subject: [sqlite] Reverse string comparison for searches Hello everyone,

[sqlite] AIX performance

2009-08-21 Thread Ken
Im looking for some ideas as to why the performance for a select statement takes roughly 5 times longer on AIX as on a linux system. The disk drive on the aix platform is a 10k scsi vs the 7200 rpm drive on linux. AIX: sqlite .timer on sqlite .output ken.out sqlite .read kdo.sql CPU Time: user

[sqlite] PRAGMA integrity_check(integer)

2009-08-21 Thread Chang Im (chim)
Hi, I have SQLite 2.x database and sometimes it takes a long time to run integrity_check on the database. Looking at the integrity_check option (integer), we could control how many errors to return from the check. I tried the option, but it generated a syntax error. Is the option supported? If

Re: [sqlite] PRAGMA integrity_check(integer)

2009-08-21 Thread Simon Slavin
On 21 Aug 2009, at 10:44pm, Chang Im (chim) wrote: I have SQLite 2.x database and sometimes it takes a long time to run integrity_check on the database. How long ? Minutes ? Hours ? Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread t-master
Igor Tandetnik wrote: t-master t-zimmerm...@onlinehome.de wrote: I have string in a table representing a DateTime. The format is 21.08.2009 00:25:00 I recommend you change the format. Yours is custom-designed to make your life miserable. And I would like to compare it to now

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Kit
2009/8/21 t-master t-zimmerm...@onlinehome.de: Hi I have string in a table representing a DateTime. The format is 21.08.2009 00:25:00 And I would like to compare it to now How can I do this? -- View this message in context:

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Simon Slavin
On 21 Aug 2009, at 11:37pm, Igor Tandetnik wrote: t-master t-zimmerm...@onlinehome.de wrote: the problem is, this db is created by another program and I don't have the access to change the format What do you mean, don't have access? Can't you just run an UPDATE statement once, that changes

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread Jean-Christophe Deschamps
´¯¯¯ (btw it's the standard datetime format in germany, not custom-designed :-P) `--- I see this as a confusion between a storage/computational format and human interface representation. US standard for date is also completely awkward MM/DD/ as well as most european (german for you,

Re: [sqlite] DateTime comparison with custom format

2009-08-21 Thread D. Richard Hipp
On Aug 21, 2009, at 7:22 PM, Jean-Christophe Deschamps wrote: US standard for date is also completely awkward MM/DD/ as well as most european (german for you, french for me) formats. That is a style or convention, not a standard. The standard is defined here:

Re: [sqlite] (no subject)

2009-08-21 Thread Jean-Christophe Deschamps
´¯¯¯ No, I meant exactly UCS-2. Because UCS-2 guarantees that all symbols are represented by 2 bytes when UTF-16 does not. And I had an understanding that Doug said about this 16-bit guarantee. Also if we're talking about encoding where any character can be represented by a single variable of