Re: [sqlite] sorting records in random order

2008-05-08 Thread Miha Vrhovnik
I think he's trying to do sth. like that SELECT quote FROM quotes ORDER BY RAND() LIMIT 1 On 5/8/2008, John Stanton [EMAIL PROTECTED] wrote: Sorting in random order is a definite contradiction in terms. What are you actually trying to do? Barbara Weinberg wrote: Hi I was wondering whether

Re: [sqlite] Comparison of SQLite applications for Mac

2008-05-08 Thread Hartwig Wiesmann
Hi Tom, SQLite Database Browser (sqlitebrowser.sourceforge.net) seems to be missing. Hartwig Am 07.05.2008 um 06:20 schrieb BareFeet: Dennis Cote wrote: 2. Know of another application that should be included. You may want to include the free SQLite Manager add on for Firefox. See

[sqlite] corrupt database with update?

2008-05-08 Thread C M
How likely (or possible) is it to corrupt or in some way screw up an SQlite database if one is doing an UPDATE and it fails? (computer goes out, etc.) Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Comparison of SQLite applications for Mac

2008-05-08 Thread Neville Franks
Hi Hartwig, The last release for this was Apr 2005 so it looks like it has died. I'm also working on a mini-review of SQLite GUI DB Managers for Windows. I'll post to the list when it is ready. Thursday, May 8, 2008, 4:45:09 PM, you wrote: HW Hi Tom, HW SQLite Database Browser

Re: [sqlite] Comparison of SQLite applications for Mac

2008-05-08 Thread Marco Bambini
Please take a look also at my SQLiteManager app: http://www.sqlabs.net/sqlitemanager.php --- Marco Bambini http://www.sqlabs.net http://www.sqlabs.net/blog/ http://www.sqlabs.net/realsqlserver/ On May 8, 2008, at 8:56 AM, Neville Franks wrote: Hi Hartwig, The last release for this was Apr

[sqlite] Actually delete deleted rows from databasefile

2008-05-08 Thread Roar Bjørgum Rotvik
Hi, I see that when I perform a delete from ... to delete a row in the database, the actual data still remains in the database file. Creates a test database and insert some values: # sqlite3 test.db SQLite version 3.3.6 Enter .help for instructions sqlite create table foo (a integer, b text);

Re: [sqlite] Actually delete deleted rows from databasefile

2008-05-08 Thread Dan
On May 8, 2008, at 2:22 PM, Roar Bjørgum Rotvik wrote: Hi, I see that when I perform a delete from ... to delete a row in the database, the actual data still remains in the database file. Creates a test database and insert some values: # sqlite3 test.db SQLite version 3.3.6 Enter

Re: [sqlite] Actually delete deleted rows from databasefile

2008-05-08 Thread Roar Bjørgum Rotvik
Dan wrote: I tried two more inserts into the table, but the two string is still visible in the database file, the file instead grows. What is the rule for reusing a deleted block (if it is so)? I guess it depends on the size of the new records inserted how space is allocated for

[sqlite] delimiting text with embedded quotes

2008-05-08 Thread cmartin
I am converting text data from another database into SQLite. Some text data has embedded apostrophes like this: This was George's big day Other data has embedded double quotes like this: The box is 3 wide I am generating INSERT INTO statements for thousands of records to be used in a

Re: [sqlite] delimiting text with embedded quotes

2008-05-08 Thread Filip Navara
You don't want to use double quotes for strings actually, they can refer to column names. The correct way is to use single quotes (') and escape the quotes in actual text by using two single quotes (''). F. On Thu, May 8, 2008 at 12:47 PM, [EMAIL PROTECTED] wrote: I am converting text data

Re: [sqlite] corrupt database with update?

2008-05-08 Thread D. Richard Hipp
On May 8, 2008, at 2:54 AM, C M wrote: How likely (or possible) is it to corrupt or in some way screw up an SQlite database if one is doing an UPDATE and it fails? (computer goes out, etc.) Thank you.\ http://www.sqlite.org/atomiccommit.html D. Richard Hipp [EMAIL PROTECTED]

Re: [sqlite] Comparison of SQLite applications for Mac

2008-05-08 Thread BareFeet
Hi Marco, I've added the SQLite Manager for Firefox to my review matrix of SQLite GUI software at: http://www.tandb.com.au/sqlite/compare/?mlp If anyone else knows of another program worth adding to the mix, please let me know. Please take a look also at my SQLiteManager app:

[sqlite] (no subject)

2008-05-08 Thread sebastian stephenson
what do I need to do to build sqlite? see ya sebey ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] build sqlite(noob quedstion)

2008-05-08 Thread sebastian stephenson
Begin forwarded message: From: sebastian stephenson [EMAIL PROTECTED] Date: 8 May 2008 12:37:54 IST To: sqlite-users@sqlite.org what do I need to do to build sqlite? see ya sebey see ya sebey ___ sqlite-users mailing list

Re: [sqlite] delimiting text with embedded quotes

2008-05-08 Thread P Kishor
On 5/8/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am converting text data from another database into SQLite. Some text data has embedded apostrophes like this: This was George's big day Other data has embedded double quotes like this: The box is 3 wide I am generating

Re: [sqlite] sorting records in random order

2008-05-08 Thread Dennis Cote
Barbara Weinberg wrote: I was wondering whether anyone had tried sorting records in random order using sqlite3. I tried sorting by random() and randomblob() but it was very slow and chewed up lots of resources. Any suggestions? Can you provide any more details about what you are trying to

Re: [sqlite] sorting records in random order

2008-05-08 Thread P Kishor
On 5/7/08, Dennis Cote [EMAIL PROTECTED] wrote: Samuel Neff wrote: This query runs slow: SELECT id FROM data ORDER BY random(); but this equivalent query runs very fast: SELECT id FROM (SELECT id, random() r FROM data) ORDER BY r; I couldn't see how these would be

Re: [sqlite] sorting records in random order

2008-05-08 Thread John Stanton
Dennis Cote wrote: Barbara Weinberg wrote: I was wondering whether anyone had tried sorting records in random order using sqlite3. I tried sorting by random() and randomblob() but it was very slow and chewed up lots of resources. Any suggestions? Can you provide any more details about what

Re: [sqlite] delimiting text with embedded quotes

2008-05-08 Thread Teg
Hello P, If you use parameterized inserts doesn't this whole issue just go away? I used to have to mess with escaping strings and so forth. Now that I compile and bind the strings to the statements, I don't have to mess with it any more. C Thursday, May 8, 2008, 9:11:40 AM, you wrote: PK On

Re: [sqlite] sorting records in random order

2008-05-08 Thread P Kishor
On 5/8/08, Barbara Weinberg [EMAIL PROTECTED] wrote: This is my query: select phn,random() as ran from demographics where sex='F' and dob = 19400401 and dob =19450331 order by ran limit 500 The original table has 7 million records and I am trying to select a subset of about 4 and sort

Re: [sqlite] sorting records in random order

2008-05-08 Thread Barbara Weinberg
The 4 is the subset that my where clause cuts it down to. Not so relevant perhaps/ Where is your perl script. I would love to see it. Many thanks! B On Thu, May 8, 2008 at 10:44 AM, P Kishor [EMAIL PROTECTED] wrote: On 5/8/08, Barbara Weinberg [EMAIL PROTECTED] wrote: This is my query:

Re: [sqlite] sorting records in random order

2008-05-08 Thread P Kishor
On 5/8/08, Barbara Weinberg [EMAIL PROTECTED] wrote: The 4 is the subset that my where clause cuts it down to. Not so relevant perhaps/ Where is your perl script. I would love to see it. Many thanks! I sent it to the list 3 hours ago. Check the thread/archives. But, here goes again --

[sqlite] SQLITE_BUSY returned from sqlite3_finalize

2008-05-08 Thread brethal
If I run the following code I get some unexpected results: sqlite3* db1_p = 0; const int open1Res = sqlite3_open16(Ltest.db, db1_p); sqlite3* db2_p = 0; const int open2Res = sqlite3_open16(Ltest.db, db2_p); sqlite3_stmt*

Re: [sqlite] sorting records in random order

2008-05-08 Thread John Stanton
I would use a PRNG with limits set for the full size of your data set and extract a rowids and select that rows then store the seed and iterate 500 times, or whatever the size of your sample. That should give you a random distribution. Barbara Weinberg wrote: This is my query: select