Re: [sqlite] Direct access of table data

2010-04-23 Thread Black, Michael (IS)
If insert speed is important are you doing batch inserts? If so, you want to do a BEGIN/COMMIT to speed up your inserts a LOT. Default action is to defer which mean no database locks occur during your inserts. http://www.sqlite.org/lang_transaction.html Michael D. Black Senior Scientist Northro

Re: [sqlite] Direct access of table data

2010-04-23 Thread Black, Michael (IS)
on Systems From: [email protected] on behalf of Nathan Biggs Sent: Fri 4/23/2010 8:05 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Direct access of table data Yes, I do use batch inserts. On 4/23/2010 8:56 AM, Black, Michael

Re: [sqlite] Is there any memory leak in the code while being busy?

2010-04-23 Thread Black, Michael (IS)
You need to sqlite3_free(sql) after you use the sql from your sqlite3_mprintf(). sql = sqlite3_mprintf (sql_f, i); ret = sqlite3_prepare_v2 (db1, sql, -1, &p_stmt, NULL); sqlite3_free(sql); Michael D. Black Senior Scientist Northrop Grumman Mission Systems ___

Re: [sqlite] Is there any memory leak in the code while being busy?

2010-04-24 Thread Black, Michael (IS)
the leak. Black, Michael (IS) wrote: > > You need to sqlite3_free(sql) after you use the sql from your > sqlite3_mprintf(). > > sql = sqlite3_mprintf (sql_f, i); > ret = sqlite3_prepare_v2 (db1, sql, -1, &p_stmt, NULL); > sqlite3_free(sql)

Re: [sqlite] Is there any memory leak in the normal routine?

2010-04-24 Thread Black, Michael (IS)
I confirmed your "memory leak". What you're seeing is the page cache growing. Not really a memory leak. Default page cache size is 2000 and indeed if I just let it run it topped out at 5404 RES in top. I added dmalloc to sqlite3 and found that if you let your program loop several times an

Re: [sqlite] values containing dash - not evaluated

2010-04-26 Thread Black, Michael (IS)
First off confirm it's not a bug with sqlite2: sqlite> create table Groups (name varchar(10)); sqlite> insert into Groups values('bob'); sqlite> insert into Groups values('jean-baptiste'); sqlite> select * from Groups where name='jean-baptiste'; jean-baptiste If you don't get a results this way

Re: [sqlite] Searching with like for a specific start letter

2010-04-26 Thread Black, Michael (IS)
When you say "running on the fly" do you mean running from an sqlite3 command prompt? Or are you doing this in some other programming language? Why in the world would you use a database to do this? Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] Hypothetical memory consumption question

2010-04-27 Thread Black, Michael (IS)
We just went through this the other day. You want to change # define SQLITE_DEFAULT_CACHE_SIZE 2000 To something smaller since you don't apparently need the cache space. It will only grow to about 3Meg on a 32-bit system apparently. Try making it 10 or less and you should see your process

Re: [sqlite] CHECK constraints and type affinity

2010-04-28 Thread Black, Michael (IS)
Hmmm...when I get rid of the "+'" CREATE TABLE T1 (N INTEGER CHECK(N >= 0)); the constraint works Seems to me that "+N" is the same as "abs(N)". I'm not even sure of what the intent of "+N" would be??? Michael D. Black Senior Scientist Northrop Grumman Mission Systems _

Re: [sqlite] SQlite trigger issues

2010-04-29 Thread Black, Michael (IS)
U...write one? As noted -- no DBMS provides this type of interface that I've ever seen...as intuitive as you may think it is. They would end up doing the same thing that was suggested here. What you need is to set up a trigger, then write your own sqlite_execute_select_query(string quer

Re: [sqlite] SQLite memory leakage

2010-04-29 Thread Black, Michael (IS)
You'll have the growth until the CACHE is full. That stays until you vacuum it. An initial large select could fil the cache entirely in one call. Then you'll have the very temporary memory of storage from the select -- but that should disappear as soon as you finalize your statement. So...

Re: [sqlite] SQLite memory leakage

2010-04-29 Thread Black, Michael (IS)
sqlite.org on behalf of Black, Michael (IS) Sent: Thu 4/29/2010 6:57 AM To: [email protected]; General Discussion of SQLite Database Subject: Re: [sqlite] SQLite memory leakage You'll have the growth until the CACHE is full. That stays until you vacuum it. An initial large select could

Re: [sqlite] CHECK constraints and type affinity

2010-04-29 Thread Black, Michael (IS)
Get rid of the quotes in your values. sqlite> create table t2(n integer check(typeof(n)='integer')); sqlite> insert into t2 values('5'); Error: constraint failed sqlite> insert into t2 values(5); sqlite> select n from t2; 5 Michael D. Black Senior Scientist Northrop Grumman Mission Systems _

Re: [sqlite] CHECK constraints and type affinity

2010-04-29 Thread Black, Michael (IS)
l other external sources. Note: variable binding is impossible for dynamically created views, triggers, etc. And modern languages can use string representation of variables in SQLite bindings. 2010/4/29 Black, Michael (IS) : > Get rid of the quotes in your values. > > sqlite> create table

Re: [sqlite] CHECK constraints and type affinity

2010-04-29 Thread Black, Michael (IS)
If you want only positive values: sqlite> create table t3(n integer check(abs(round(n)) = n)); sqlite> insert into t3 values('-5'); Error: constraint failed Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.

Re: [sqlite] WHERE = does not work

2010-04-30 Thread Black, Michael (IS)
Apparently you must by typeing something wrong. This works for me: create table t(resourceType varchar); insert into t values('PSM'); select * from t where resourceType = 'PSM'; PSM select * from t where resourceType like 'PSM'; PSM Does this work for you? I'm using 3.6.23.1 Michael D. Bl

Re: [sqlite] WHERE = does not work

2010-04-30 Thread Black, Michael (IS)
You are likely getting the case insensitive result with "like". sqlite> create table t(resourceType varchar); sqlite> insert into t values('PSM'); sqlite> insert into t values('psm'); sqlite> select * from t where resourceType = 'PSM'; PSM sqlite> select * from t where resourceType like 'PSM'; PS

Re: [sqlite] WHERE = does not work

2010-04-30 Thread Black, Michael (IS)
846|PSM 2010-04-28 17:47:12.001|PSM 2010-04-28 17:47:13.845|PSM 2010-04-28 17:47:16.837|PSM 2010-04-28 17:47:18.846|PSM sqlite> sqlite> sqlite> select timeStamp, resourceType From MyTable where resourceType = 'PSM' LIMIT 10; sqlite> sqlite> sqlite> THANKS On Fri, Apr

Re: [sqlite] WHERE = does not work

2010-04-30 Thread Black, Michael (IS)
010-04-28 17:47:13.845|PSM 2010-04-28 17:47:16.837|PSM 2010-04-28 17:47:18.846|PSM sqlite> sqlite> sqlite> select timeStamp, resourceType From MyTable where resourceType = 'PSM' LIMIT 10; sqlite> sqlite> sqlite> THANKS On Fri, Apr 30, 2010 at 9:35 AM, Black, Michael (IS)

Re: [sqlite] "restore" doesn't work

2010-04-30 Thread Black, Michael (IS)
Hmmm...works for me on windows and Linux -- I used the default configuration for compiling 3.6.23.1 under Linux. I also removed write permissions to test.db and it still worked. There are a limited number of places where SQLITE_READONLY error can occur. Why don't you set some debug breakpoints

Re: [sqlite] "restore" doesn't work

2010-04-30 Thread Black, Michael (IS)
Also..was your database created on the same machine you're restoring on? Page size difference will create this error too. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Alexey Pechnikov S

Re: [sqlite] "restore" doesn't work

2010-04-30 Thread Black, Michael (IS)
exey Pechnikov Sent: Fri 4/30/2010 9:25 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] "restore" doesn't work The problem is really produced by the different page_size. I did have bugreport from my client and it's not easy to reproduce the problem by thi

Re: [sqlite] select %column% from table

2010-04-30 Thread Black, Michael (IS)
Create a view with your columns that you can easily reference: http://www.1keydata.com/sql/sql-create-view.html Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of David Lyon Sent: Fri 4/30/2010

Re: [sqlite] WHERE = does not work

2010-04-30 Thread Black, Michael (IS)
which I assume separates the columns). On Fri, Apr 30, 2010 at 10:02 AM, Black, Michael (IS) < [email protected]> wrote: > Also...what do you get from a .dump ?? Any extra chars should show up in > the SQL statements. > > Michael D. Black > Senior Scientist > Northrop

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Black, Michael (IS)
Simon's answer is probably best -- without any benchmarks it makes the most sense. You've got at least two solutions that don't require changing your data: SELECT x FROM userTable WHERE upper(name) = upper('name'); SELECT x FROM userTable WHERE name = 'name' COLLATE NOCASE. And one solutio

Re: [sqlite] Optimising usage of LIKE

2010-05-03 Thread Black, Michael (IS)
n it's original form. I would favor normalizing the data on the INSERT. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Black, Michael (IS) Sent: Mon 5/3/2010 5:58 AM To: General Discussio

Re: [sqlite] Doing fine with SQLite

2010-05-04 Thread Black, Michael (IS)
echo .mode csv >input.sql echo select * from selected limit 4 >>input.sql sqlite3 test.db http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinf

Re: [sqlite] Changing file descriptor of database file

2010-05-08 Thread Black, Michael (IS)
The select() limit has nothing to do with sqlite. You already noted it's a limit on sockets -- it's really an OS limit. Do you have any idea what your max is or what you think you need? I see some solutions and upcoming problems (by the way, you forgot to mention what OS you're on). #1 You

Re: [sqlite] SQLite Database in Shared Memory

2010-05-11 Thread Black, Michael (IS)
Just 'cuz you don't need persitence now of course doesn't mean you can't use it. That solves your "shared memory" problem even though it's not as elegant. You can even access via file shares that way too which sounds a bit like what you may want do anyways. Michael D. Black Senior Scientist

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-11 Thread Black, Michael (IS)
Your "reiterating 20 times" is not using a usleep so you'll blow by this most every time it's busy. Do this instead in all your proc's ret = sqlite3_step (p_stmt); if (SQLITE_BUSY == ret) { int n=0; usleep(10); // try one more time be

Re: [sqlite] SQLite Database in Shared Memory

2010-05-11 Thread Black, Michael (IS)
I think you may be worrying too much about file speed as it's already pretty fast. But if you want AIX ramdisk check here: http://www.ee.pw.edu.pl/~pileckip/aix/mkramdisk.htm Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-

Re: [sqlite] create virtual table if not exists table_id???

2010-05-11 Thread Black, Michael (IS)
Syntax says they are different...virtual tables don't have the same flexibility apparently...I suppose you're looking for "why" though? http://www.sqlite.org/lang_createvtab.html Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlit

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-12 Thread Black, Michael (IS)
ovement is the disappear of the error of SQLITE_MISUSE. And I tried to use the "BEGIN EXCLUSIVE TRANSACTION". The things are same with them without using it. Black, Michael (IS) wrote: > > Your "reiterating 20 times" is not using a usleep so you'll blow by th

Re: [sqlite] Attach

2010-05-12 Thread Black, Michael (IS)
H...I duplicated this behavior on 3.6.23.1...I can only assume this is by intent as the interpreter isn't designed for mulitiple attached databases. .dump doesn't work on an attached table either Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] Insert large data question ??

2010-05-12 Thread Black, Michael (IS)
You haven't said what kind of machine you're running on. I did this test using 9,000,000 records and got 40,000 inserts per second. sqlite3 test.db : > On Tue, May 11, 2010 at 12:47 AM, ?? wrote: >> Dear >> >> I have about 9 million data insert string need to insert into an table ,each >> row

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-13 Thread Black, Michael (IS)
27;t succeed in finalizing the sqlite3_stmt pointer? Black, Michael (IS) wrote: > > SQLITE_BUSY is not an error...just a fact. > > All your processes cannot work on the database at the same time...at least > not when one of them is doing an insert. You could be changing the ta

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-13 Thread Black, Michael (IS)
ements one can loop while sqlite3_stmt returns SQLITE_BUSY. But even in this case one must call sqlite3_reset on the statement that returned SQLITE_BUSY. And this call to sqlite3_reset will return SQLITE_BUSY again. Pavel On Thu, May 13, 2010 at 7:20 AM, Black, Michael (IS) wrote: > It also m

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-13 Thread Black, Michael (IS)
n put words "error code" in this text instead of "SQLITE_ERROR", its meaning will be the same - if you call sqlite3_step after an error again then SQLITE_MISUSE will be returned (although from my experience in some cases repeated sqlite3_step can work, but generally you bett

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-14 Thread Black, Michael (IS)
_stmt returns SQLITE_BUSY. But even in this case one must call > sqlite3_reset on the statement that returned SQLITE_BUSY. And this > call to sqlite3_reset will return SQLITE_BUSY again. > > > Pavel > > On Thu, May 13, 2010 at 7:20 AM, Black, Michael (IS) > wrote: &g

Re: [sqlite] multi processes, so many errores of SQLITE_BUSY and SQLITE_MISUSE

2010-05-14 Thread Black, Michael (IS)
certain type of statements one can loop while > sqlite3_stmt returns SQLITE_BUSY. But even in this case one must call > sqlite3_reset on the statement that returned SQLITE_BUSY. And this > call to sqlite3_reset will return SQLITE_BUSY again. > > > Pavel > > On Thu, May 13,

Re: [sqlite] Bus error crash in SQLite

2010-05-15 Thread Black, Michael (IS)
This has been fixed http://www.sqlite.org/src/info/f3162063fd Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Ben Sent: Sat 5/15/2010 7:27 AM To: General Discussion of SQLite Database Subj

Re: [sqlite] Bus error crash in SQLite

2010-05-15 Thread Black, Michael (IS)
I tested your code with the latest fossil checkout It now gets this: sqlite> INSERT INTO "stuff" DEFAULT VALUES; Error: stuff.name may not be NULL Which makes sense as you didn't specify a default value for it. So adding this: name TEXT NOT NULL DEFAULT 'unk'; produces this: sqlite> INSERT I

Re: [sqlite] read only databases and in-memory databases

2010-05-17 Thread Black, Michael (IS)
Well...you don't say what "problem" your customers are having. Would be nice to know for us to help you. But it sounds a LOT like you're not handling SQLITE_BUSY returns. You may be seeing SQLITE_BUSY returns from your "read data...and put" step. But that assumes you're looking for it from

Re: [sqlite] Crash SQLite [version: 3.6.23.1; tested: shell]

2010-05-17 Thread Black, Michael (IS)
This bug was fixed (we just went though this last week). Download a recent fossil repository and you'll be good. Sounds kind of like it's time for a new release to me. Is there any planned time for 3.7.0? Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] read only databases and in-memory databases

2010-05-17 Thread Black, Michael (IS)
[email protected] on behalf of Sam Carleton Sent: Mon 5/17/2010 9:04 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] read only databases and in-memory databases On Mon, May 17, 2010 at 9:32 AM, Black, Michael (IS) wrote: > Well...you don't say what "problem

Re: [sqlite] read only databases and in-memory databases

2010-05-17 Thread Black, Michael (IS)
ng assumption is correct: *If you only need read-only access, open it in read-only, fore it plays nicer with other threads that are also doing read-only operations.* Sam On Mon, May 17, 2010 at 10:48 AM, Black, Michael (IS) < [email protected]> wrote: > By "breakdown in comm

Re: [sqlite] read only databases and in-memory databases

2010-05-18 Thread Black, Michael (IS)
2010 3:46 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] read only databases and in-memory databases On Mon, May 17, 2010 at 2:27 PM, Black, Michael (IS) wrote: > Not rude -- just a communications problem... > > There's a difference between read-only and exclusive

Re: [sqlite] read only databases and in-memory databases

2010-05-18 Thread Black, Michael (IS)
[email protected] on behalf of Sam Carleton Sent: Tue 5/18/2010 9:57 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] read only databases and in-memory databases On Tue, May 18, 2010 at 7:35 AM, Black, Michael (IS) wrote: > I think I see a potential problem with your logic. You

Re: [sqlite] read only databases and in-memory databases

2010-05-18 Thread Black, Michael (IS)
On 18 May 2010, at 4:19pm, Black, Michael (IS) wrote: > Interesting...but that logic means that later processes might get their > results before earlier ones. There is no harm in this. In fact it's a characteristic of parallel systems. If it truly mattered which order the results arr

Re: [sqlite] read only databases and in-memory databases

2010-05-18 Thread Black, Michael (IS)
burning a lot of CPU why not spin the BUSY as fast as > possible? Spinning without sleeping *always* burn *a lot* of CPU, no matter what you do inside your cycle. Pavel On Tue, May 18, 2010 at 1:24 PM, Black, Michael (IS) wrote: > Actually I wonder if the sqlite3 mutex calls woul

Re: [sqlite] read only databases and in-memory databases

2010-05-18 Thread Black, Michael (IS)
} sqlite3_close (db); return 0; } Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Jay A. Kreibich Sent: Tue 5/18/2010 2:12 PM To: General Discussion of SQLite Database Subject: Re: [s

Re: [sqlite] read only databases and in-memory databases

2010-05-19 Thread Black, Michael (IS)
you (on Linux it's about 10ms IIRC). Pavel On Tue, May 18, 2010 at 1:50 PM, Black, Michael (IS) wrote: > Rats on the interprocess locks. > > I was still talking about sleeping for spinning the BUSY return -- but just > doing it as fast as possible without using much CPU instead of

Re: [sqlite] Delete from FTS3 with ROWID really really slow.....

2010-05-19 Thread Black, Michael (IS)
Try showing us an "explain" of your statements. Also seeing your table structure might help. I take it you have a lot of keywords (like multiple 100,000's) Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqli

Re: [sqlite] Leading zeros disappear

2010-05-19 Thread Black, Michael (IS)
Are you putting single quotes around it? That's what you need. sqlite> create table text (t1 text, t2 varchar); sqlite> insert into text values ('01234','01234'); sqlite> select * from text; 01234|01234 sqlite> insert into text values (01234,01234); sqlite> select * from text; 01234|01234 1234|123

Re: [sqlite] SQLite file Validation

2010-05-19 Thread Black, Michael (IS)
When you say "create a function" -- sure you can write your own program that would do that -- but it sounds like you want something to intercept all the calls, yes? You could create an insert or update trigger. Then write your own cleanup sqlite function to stick in the trigger. Shouldn't b

Re: [sqlite] SQLite file Validation

2010-05-19 Thread Black, Michael (IS)
on Systems From: [email protected] on behalf of Black, Michael (IS) Sent: Wed 5/19/2010 2:49 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite file Validation When you say "create a function" -- sure you can write y

Re: [sqlite] What languages can include SQLite statically?

2010-05-21 Thread Black, Michael (IS)
It looks like FreeBasic should work http://www.freebasic.net/ You just have to build the include file -- hopefully that's not too hard for you as you probably only need a few of the functions. Michael D. Black Senior Scientist Northrop Grumman Mission Systems ___

Re: [sqlite] [lcc32] "sqlite3.c:6597 Character constant taken as notsigned"

2010-05-21 Thread Black, Michael (IS)
I would recommend Code::Blocks which will give you a GUI to work with too. You just need to learn how to compile which isn't hard at all. You just add your source modules to your project and "Build". http://www.codeblocks.org/ Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] What languages can include SQLite statically?

2010-05-21 Thread Black, Michael (IS)
[email protected] on behalf of Gilles Ganault Sent: Fri 5/21/2010 6:41 AM To: [email protected] Subject: Re: [sqlite] What languages can include SQLite statically? On Fri, 21 May 2010 06:28:20 -0500, "Black, Michael (IS)" wrote: >It looks like FreeBasic should work >http://w

Re: [sqlite] What languages can include SQLite statically?

2010-05-21 Thread Black, Michael (IS)
Or fbc sqlite3_test.bas sqlite3.o You didn't say what plafform you're running on so I assume 32-bit Windows? Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Black, Michael (IS) S

Re: [sqlite] Fw: What languages can include SQLite statically?

2010-05-21 Thread Black, Michael (IS)
MS Visual Studio Express should work just fine. If you're used to MS products. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Gilles Ganault Sent: Fri 5/21/2010 7:26 AM To: sqlite-users@sql

Re: [sqlite] Fw: What languages can include SQLite statically?

2010-05-21 Thread Black, Michael (IS)
ael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Black, Michael (IS) Sent: Fri 5/21/2010 7:30 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Fw: What languages can include SQLite stati

Re: [sqlite] UTF16 - sqlite3_prepare16_v2

2010-05-22 Thread Black, Michael (IS)
I think you're making the mistake of thinking that the entire SQL string is UTF-16. Look at the API for sqlite3_prepare16_v2 SQLITE_API int sqlite3_prepare16_v2( sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-8 encoded SQL statement. */ It's your data fiel

Re: [sqlite] UTF16 - sqlite3_prepare16_v2

2010-05-22 Thread Black, Michael (IS)
[email protected] on behalf of Jay A. Kreibich Sent: Sat 5/22/2010 9:43 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] UTF16 - sqlite3_prepare16_v2 On Sat, May 22, 2010 at 09:23:06AM -0500, Black, Michael (IS) scratched on the wall: > I think you're making the mistak

Re: [sqlite] Strange SQLITE_FULL error

2010-05-24 Thread Black, Michael (IS)
If you'll note in the code it does set lastErrno to the GetLastError() return. Hopefully you have control of the code so you can add an "sqlite3_file_control" call to see what's going on. You should be able to do this when you get the SQLITE3_FULL return code. int errnum; sqlite3_file_control(

Re: [sqlite] network access problem

2010-05-24 Thread Black, Michael (IS)
That's not a valid file path for open(). You need to mount the share as a drive before you can use it. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Art Sent: Mon 5/24/2010 1:28 PM To: s

Re: [sqlite] File locking with BEGIN/END

2010-05-25 Thread Black, Michael (IS)
You need to add your records in smaller batches and sleep just a little between iterations. Your batches will have to be small enough to make the user response time reasonable. You'll find that your loop of inserting records won't take long. It's when you do the "COMMIT" that it locks every

Re: [sqlite] How accept sqlite3 commands from stdin

2010-05-25 Thread Black, Michael (IS)
sqlite3 main.db < main.txt or cat main.txt | sqlite3 main.db or echo "create table tbl1(one varchar(10), two smallint);" | sqlite3 main.db Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behal

Re: [sqlite] how to search for asterix character?

2010-05-26 Thread Black, Michael (IS)
This works for me: sqlite> create table t(t varchar); sqlite> insert into t values('Testing*with asterisk'); sqlite> insert into t values('Testing without asterisk'); sqlite> select * from t; Testing*with asterisk Testing without asterisk sqlite> select * from t where t like '%*%'; Testing*with a

Re: [sqlite] FTS1 or FTS2

2010-05-26 Thread Black, Michael (IS)
Or to more directly answer the question... select * from phone where number like '%56%'; Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Simon Slavin Sent: Wed 5/26/2010 12:25 PM To: Gen

Re: [sqlite] network access problem

2010-05-27 Thread Black, Michael (IS)
One thing to be clear on. What OS are you running in your Virtualbox? I hope it's not unix-flavored as that could/would be your problem. Also...you didn't say that read/write worked over the UNC path...only that read-only failed. Michael D. Black Senior Scientist Northrop Grumman Mission S

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Black, Michael (IS)
So only do N many records in one batch. That's the easiest thing. Forget about the cache and just use responsiveness to adjust how many records you allow at once. Pseudo-code: recnum=0 BEGIN; while more records INSERT recnum++ if (recnum % 1000) COMMIT; BEGIN;

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Black, Michael (IS)
eoretically count the number of DML statements or steps, but this would imply changing the underlying architecture of the application, so that any plug-in or extension that accesses SQLite also reports how much data did they change. It's not very convenient. Kind regards, Igor Black, Michael (IS)

Re: [sqlite] Aggregate and join query very slow

2010-05-27 Thread Black, Michael (IS)
MySql has a much larger default cache than sqlite3. That could be one rather large difference in performance. Try increasing sqlite3 cache from it's default of 2000k PRAGMA cache_size=10; Or more... Also...no indexes on media or year? And what does MySql's explain say? Michael D. Bla

Re: [sqlite] Aggregate and join query very slow

2010-05-28 Thread Black, Michael (IS)
You also need to increase your cache size to match the mysql performance pragma cache 10; Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Michael Ash Sent: Fri 5/28/2010 9:57 AM To: sq

Re: [sqlite] UTC/GMT conversion back and forth

2010-05-29 Thread Black, Michael (IS)
sqlite> create table t (d integer); sqlite> insert into t values (datetime('now')); sqlite> select * from t; 2010-05-29 11:19:20 << you'll note this should be in GMT sqlite> select datetime(d,'localtime') from t; 2010-05-29 06:19:20 You can, of course, get your time in whatever format you want.

Re: [sqlite] Simple Sample Code [Linked]

2010-05-31 Thread Black, Michael (IS)
Nice example Gary...pretty clean. But...could I be so bold as to recommend you complete it with BUSY and LOCKED possibilities? Man will likely use your code as-is. I remember a long time ago seeing some examples in a computer programming book by Knuth or such in my college classes. Along wi

Re: [sqlite] What languages can include SQLite statically?

2010-06-01 Thread Black, Michael (IS)
About the only thing you'll find cross-platform + embedded is C/C++ For an IDE use Code::Blocks as it is cross-platform Windows/Unix (no embedded though of course). But does run gcc on both. And since gcc is a popular choice for embedded that will maximize your code portability. Michael D.

Re: [sqlite] output problem

2010-06-02 Thread Black, Michael (IS)
Inside code you can use forward slash for path seperators (dang Microsoft for ever introducing this backslash stuff). so this works on ALL windows operating systems that I know of .output c:/done.txt Note though that if your user doesn't have admin priveledges they may not be able to write t

Re: [sqlite] Problem with sqlite3

2010-06-03 Thread Black, Michael (IS)
First off I assume you two know the difference between a DLL .LIB and a static .LIB -- they are different. I used Microsoft Visual C++ Studio 2010 Express and 2008 Express and downloaded the windows sqlite3 DLL from the website http://www.sqlite.org/sqlitedll-3_6_23_1.zip #1 Open a Visual S

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Black, Michael (IS)
This is a bit weird...it appears it's just the = operator causing this... sqlite> select * from t where c1>=5 and c2>0 and c2<='2'; sqlite> select * from t where c1<=5 and c2>0 and c2<='2'; sqlite> select * from t where c1=5 and c2>0 and c2<='2'; 5|5 sqlite> drop index t_c1_c2; sqlite> select * f

Re: [sqlite] [BUG] Adding an index changes query result

2010-06-09 Thread Black, Michael (IS)
Pavel -- did you miss my test here? sqlite> select * from t where c1>=5 and c2>0 and c2<='2'; sqlite> select * from t where c1<=5 and c2>0 and c2<='2'; sqlite> select * from t where c1=5 and c2>0 and c2<='2'; 5|5 sqlite> drop index t_c1_c2; sqlite> select * from t where c1<=5 and c2>0 and c2<='2'

Re: [sqlite] copy data from one db to another

2010-06-09 Thread Black, Michael (IS)
Assuming postgres can load SQL from a file you should be able to use named pipes on all 3. Here's windows: sqlite> create table t (i integer); sqlite> insert into t values(1); sqlite> insert into t values(2); sqlite> .output \\.\pipe\foo sqlite> .dump 2nd window: sqlite> .read \\.\pipe\foo sql

Re: [sqlite] bug report: unhelpful error message when directorypermissions are wrong

2010-06-11 Thread Black, Michael (IS)
I did the following...so what kind of permissions do you have that are different from this? drwxr-xr-x 2 root root 4096 Jun 11 08:40 ./ -rw-r--r-- 1 root root 2048 Jun 11 08:40 test.db As a normal user I did this: sqlite3 test.db SQLite version 3.3.6 Enter ".help" for instructions sqlite>

Re: [sqlite] bug report: unhelpful error message whendirectorypermissions are wrong

2010-06-11 Thread Black, Michael (IS)
[email protected] on behalf of Pavel Ivanov Sent: Fri 6/11/2010 8:58 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] bug report: unhelpful error message whendirectorypermissions are wrong > What's different about your setup? Different permissions on the directory or > fi

Re: [sqlite] output problem

2010-06-14 Thread Black, Michael (IS)
The command-line interface is not multi-threaded so it all executes in sequence. I can't imagine how many questions/problems would be on this list if it were multi-threaded...yikes!! Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: s

[sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
I've been seing this the last 2-3 weeks whenever I email the list...is it just me??? This is the mail system at host sqlite.org. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
_ From: [email protected] on behalf of Richard Hipp Sent: Mon 6/14/2010 7:46 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Mail loop? It is not just you. But I have no idea what the problem is or how to fix it. On Mon, Jun 14, 2010 at 8:43 AM, Black, Mich

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
From: [email protected] on behalf of Richard Hipp Sent: Mon 6/14/2010 8:30 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Mail loop? On Mon, Jun 14, 2010 at 9:09 AM, Black, Michael (IS) wrote: > The problem is that somebody has a .forward or such which loop

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
throp Grumman Mission Systems From: [email protected] on behalf of P Kishor Sent: Mon 6/14/2010 8:12 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Mail loop? On Mon, Jun 14, 2010 at 8:09 AM, Black, Michael (IS) wrote: > The prob

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
lack Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Richard Hipp Sent: Mon 6/14/2010 8:30 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Mail loop? On Mon, Jun 14, 2010 at 9:09 AM, Blac

Re: [sqlite] SELECT behaviour with INDEX

2010-06-17 Thread Black, Michael (IS)
Is there any advantage/disadvantage to having seperate indexes in a case like this? In other words, as a simple design goal to have a separate index that matches whatever you select on and order on? It seems to me that if you do "SELECT * FROM log WHERE id_clie...@idclient ORDER BY utc DESC

Re: [sqlite] c compiler during install

2010-06-17 Thread Black, Michael (IS)
You probably don't have the gcc package installed. You're seeing an i386 compiler which may not produce what you want plus you won't necessarily have all the header files you need. And did you add that directory path to cc1 yourself to your PATH? It's quite non-standard and should be removed

Re: [sqlite] SELECT behaviour with INDEX

2010-06-17 Thread Black, Michael (IS)
antage to having seperate indexes in a case like > this? SQLite uses at maximum one index per table per query. So there is a big disadvantage in having separate indexes especially if @IdClient is not selective enough. Pavel On Thu, Jun 17, 2010 at 9:44 AM, Black, Michael (IS) wrote: &

Re: [sqlite] c compiler during install

2010-06-17 Thread Black, Michael (IS)
You missed this step: After you "su" you are "root". Then: yum install gcc Then do your configure and install. Should work fine. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Glen Scr

Re: [sqlite] c compiler during install

2010-06-17 Thread Black, Michael (IS)
You must not be a RHN subscriber. So you'll have to install from the CD. You should be able to find gcc on the cd and do "rpm -i gcc*" It might complain about needing some other things too which you will also need to install. Or...if you have an X window running your Add/Remove Software entr

Re: [sqlite] unexpected large journal file

2010-06-20 Thread Black, Michael (IS)
Hmmma 6.5X speed diff between RAM and disk? Sounds pretty good to me. Not sure why you expect better. 10,000/sec is crappy? And you think this because Several things you need to provide. #1 What OS are you on? There are numerous disk speed testing programs depending on your O

Re: [sqlite] 64 bit libsqlite for AIX and Solaris

2010-06-24 Thread Black, Michael (IS)
You get the default for whatever platform you're compiling on. Though I'm not sure if there's any advantage/disadvantage to 64-bit binaries for sqlite3, is there? Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun..

Re: [sqlite] Why is there no test suite for ''make check' ?

2010-06-24 Thread Black, Michael (IS)
Try one directory up. It's not in the src directory Makefile. Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: [email protected] on behalf of Dr. David Kirkby Sent: Thu 6/24/2010 10:10 AM To: General Discussion of SQ

Re: [sqlite] EXTERNAL:Re: problem with auto boot

2010-07-02 Thread Black, Michael (IS)
Daniel -- you need to give more info C#'s exception messages are terrible and very non-specific as they simply indicate failure and not why. Use the C function fopen() to test your database file. If you get an error back In your simple program display a dialog box with the strerror(errn

  1   2   3   4   5   6   7   8   9   >