Re: [sqlite] EXTERNAL: Slowdown when adding terms to query

2010-08-06 Thread Black, Michael (IS)
Try putting Delivery.ID=1987654321 at the front of your query. I suspect that's a pretty small set. And I also assume you have a Delivery index for ID. Would help if you would show your indexes. Also, show the explain with and without the added column. That should show what it's doing

Re: [sqlite] EXTERNAL: Process memory space exhausted in 3.7.0

2010-08-05 Thread Black, Michael (IS)
Can you force a WAL checkpoint periodically? Also...of course test 3.7.0.1 PRAGMA database.wal_checkpoint; I assume you're doing your thing in one transaction. I would've thought WAL would notice that and do it's auto-checkpoint anyways. Can one of the experts comment on the expected

Re: [sqlite] Vacuum'ing database returns a 'PRIMARY KEY must be unique' error in 3.7.0

2010-08-05 Thread Black, Michael (IS)
What happens if you do this with 3.6.23.1 or 3.7.0.1 ? Michael D. Black Senior Scientist Advanced Analytics Directorate Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org on behalf of Scott Crosby Sent: Wed 8/4/2010 8:14 AM To:

Re: [sqlite] Command line tool always return the first column in a select

2010-08-04 Thread Black, Michael (IS)
I just ran your code on 3.6.23.1 and it works just fine. Can you try a newer version? x.sql: create table mytable (id VARCHAR(255), name VARCHAR(255), address VARCHAR(255), PRIMARY KEY(id)); insert into mytable (id, name, address) VALUES ('123abc','charlie', '123 st'); insert into mytable

Re: [sqlite] Inserting a large amount of data into a large indexed table

2010-08-04 Thread Black, Michael (IS)
I love email lists like this when people ask questions that make me want to test stuff and confirm my hypotheses. Gives me some much needed practice... Dropping your index and recreating every time you add rows is NOT the best thing to do. Quite obviously your time to create an index is

Re: [sqlite] How to write the trigger?

2010-08-03 Thread Black, Michael (IS)
You could've tested this in the time it took for you to get answer: File x.sql PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE t (i integer); INSERT INTO "t" VALUES(1); CREATE TABLE c(i integer); CREATE TRIGGER t1 before insert on t begin insert into c values((select count(*) from

Re: [sqlite] crypt() as SQL core function

2010-08-02 Thread Black, Michael (IS)
Would it be possible to have SQLite tell you "not enabled" for any functions that are not compiled in? Rather than "no such function"? So for those of us who are not familiar with all the possibilities might accidentally stumble upon them? Or...for when you start disabling functions to

Re: [sqlite] delete constraint

2010-07-31 Thread Black, Michael (IS)
I couldn't get your trigger to work properly on deleting an empty album...it still said "cannot be deleted". I ended up modifying it some..dont' know if this is your cause or not but might be worth a try to modify your trigger. PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE albums

Re: [sqlite] Help with complex UPDATE question

2010-07-24 Thread Black, Michael (IS)
I can think of several answers to your last question; #1 Your mileage may vary #2 Take the easiest way for you and see it works well. #3 Since SQL wasn't designed for vector math do it in your program -- probably MUCH clearer to anybody (including yourself) in the future. It shouldn't take

Re: [sqlite] EXTERNAL:Re: Very Slow DB Access After Reboot on Windows

2010-07-23 Thread Black, Michael (IS)
tes of DB size and I am not sure they are waiting one hour after restarting their PCs. There must be a way to solve this problem. As I said before Linux is just fine. I wish to see Linux on every PC one day. *Samet YASLAN* On 22.07.2010 22:51, Kees Nuyt wrote: > On Thu, 22 Jul 2010 10:44:50 -0500,

Re: [sqlite] Very Slow DB Access After Reboot on Windows

2010-07-22 Thread Black, Michael (IS)
Wrongread the docs...if copy didn't do binary by default there would so many screwed up computers in the world http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/copy.mspx?mfr=true Using /b /b directs the command interpreter to read the number of bytes

Re: [sqlite] Very Slow DB Access After Reboot on Windows

2010-07-22 Thread Black, Michael (IS)
Also...try doing a "copy my.db nul:" to get it cached once before you use it. You're probably running into disk head seeking the first time (due to random placement of your data relative to your query) which will slow you down a lot. Michael D. Black Senior Scientist Advanced Analytics

Re: [sqlite] VFS Layer for to split database into several files?

2010-07-19 Thread Black, Michael (IS)
lite] EXTERNAL:Re: VFS Layer for to split database into > several files? > > On Mon, Jul 19, 2010 at 01:48:56PM -0500, Black, Michael (IS) scratched > on the wall: > > NFSV2 is something that limits filesize. > > From the phrasing of the rest of your email, I assume y

Re: [sqlite] VFS Layer for to split databaseinto several files?

2010-07-19 Thread Black, Michael (IS)
Discussion of SQLite Database Subject: Re: [sqlite] EXTERNAL:Re: VFS Layer for to split databaseinto several files? On Mon, Jul 19, 2010 at 01:48:56PM -0500, Black, Michael (IS) scratched on the wall: > NFSV2 is something that limits filesize. From the phrasing of the rest of your email, I ass

Re: [sqlite] EXTERNAL:Re: VFS Layer for to split database into several files?

2010-07-19 Thread Black, Michael (IS)
nks, - James > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Black, Michael (IS) > Sent: Monday, July 19, 2010 10:51 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] VFS Layer for

Re: [sqlite] VFS Layer for to split database into several files?

2010-07-19 Thread Black, Michael (IS)
Also...would you care to elucidate what environment you're in that limits you to 2GB? I've heard numerous people before who think they're limited when, in actuality, they're not. Michael D. Black Senior Scientist Advanced Analytics Directorate Northrop Grumman Information Systems

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
org> wrote: > > > On Wed, Jul 14, 2010 at 1:34 PM, Black, Michael (IS) < > michael.bla...@ngc.com> wrote: > >> Was that a facetious remark??? >> >> Rather than "here's a function/pragma that allows you to put the journal >> file where you want

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
On Wed, Jul 14, 2010 at 1:34 PM, Black, Michael (IS) <michael.bla...@ngc.com > wrote: > Was that a facetious remark??? > > Rather than "here's a function/pragma that allows you to put the journal > file where you want -- but BE CAREFUL BECAUSE..." > > Writing you

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
Hipp Sent: Wed 7/14/2010 12:12 PM To: General Discussion of SQLite Database Subject: EXTERNAL:Re: [sqlite] Sqlite Insert Speed Optimization On Wed, Jul 14, 2010 at 12:31 PM, Black, Michael (IS) < michael.bla...@ngc.com> wrote: > If you could set the journcal location BEFORE you open

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
Yuck...do you know what bandwidth you have? Looks kind of like a T1 line to me. That should allow 100Meg to come across in about 13 minutes if it's not being used for anything else. Unless you're monitoring time usage in your application how do you know where your time is being spent? If

Re: [sqlite] Case insensitive join available?

2010-07-14 Thread Black, Michael (IS)
Add "collate nocase" to your queries. sqlite> select * from A inner join B on A.a=B.a collate nocase; a b c a d e -- -- -- -- -- -- a 4 7 A 4 7

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
Sent: Wed 7/14/2010 11:24 AM To: General Discussion of SQLite Database Subject: EXTERNAL:Re: [sqlite] Sqlite Insert Speed Optimization Black, Michael (IS) wrote: > Does anybody know how to make the journal file go to a different > location than the database? Apprarently it's not treated

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
If you don't know why it's slow you'll be shooting in the dark. And doing compression on a local network link isn't likely to buy you much. Might even hurt. In other words, is it latency or bandwidth? Give 8K/sec I'm guessing it's latency unless you're running a 64KBit line. Are you THAT

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
Now I'm confused...how can you be 50% faster if 90% of the time is in retrieving from Oracle? Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org on behalf of Werner Smit Sent: Wed 7/14/2010 11:11 AM To:

Re: [sqlite] Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
Can you answer #3 though? Does anybody know how to make the journal file go to a different location than the database? Apprarently it's not treated as a "temporary" file. Perhaps it should be?? Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] EXTERNAL:Re: Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
According to my math your final database size should be on the order of 100Meg? That means at 200 minutes and 1,000,000 records: 83 inserts per second 8333 bytes per second Both of these values are terrible. #1 What kind of network connection do you have? 100BaseT? #2 What kind of server

Re: [sqlite] EXTERNAL:Re: Sqlite Insert Speed Optimization

2010-07-14 Thread Black, Michael (IS)
You've got the source code. Modify sqlite3journalopen to put your journal in %TEMP% or or maybe getcwd(). I couldn't quite figure out where the journal filename is set -- there's no db-journal in the code so the name setting appears magjic to me. Since you've got complete control over the

Re: [sqlite] Ticks to unixepoch date

2010-07-13 Thread Black, Michael (IS)
Can you give us the values in your table? This works for me on 3.6.23.1 create table t (i integer); insert into t values(634355968); select datetime((i/100)-62135596800,'unixepoch') from t as expr1; 2011-03-13 07:06:40 Michael D. Black Senior Scientist Northrop Grumman Mission

Re: [sqlite] EXTERNAL:Re: Version 3.7.0 delayed. Was: no longer able to use read-only databases?

2010-07-12 Thread Black, Michael (IS)
I must be missing something...why does a read-only database require WAL at all? If you can't update tables then how can you use WAL? Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org on behalf of Noah

Re: [sqlite] EXTERNAL:Re: quickly insert multiple rows into multiple table

2010-07-12 Thread Black, Michael (IS)
Are you serious??? Run fast...more CPU...run slow...less CPU...you're choice. If you want to run less then 9000 rows/seconds put a sleep in there somewhere. The only reason you're at 30% and not 100% is due to your disk-speed limitation. I really can't see what you're complaining about.

Re: [sqlite] EXTERNAL: binding an IN

2010-07-12 Thread Black, Michael (IS)
Is there any reason why you need to bind it? Can't you just build the SQL string yourself? As long as your IN parameters are well-controlled I don't think it should be a security risk. Plus you can check for more then one"(" after you build the string. #include #include int

Re: [sqlite] EXTERNAL: Terminate blocking SELECT-operation?

2010-07-12 Thread Black, Michael (IS)
Do you maybe want a combination of http://www.sqlite.org/c3ref/progress_handler.html And http://www.sqlite.org/c3ref/interrupt.html If you really need asynch queries then I think you'll have to thread it or fork it yourself. Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] EXTERNAL: database is locked(5) too often - what am i doing wrong?

2010-07-12 Thread Black, Michael (IS)
Combining your transactions would probably help a fair bit. And I think you're sleeping WAY too long. Besides upgrading your sqlite use sqlite3_busy_timeout() -- it will handle the sleeps for you and do it much faster than what you're doing (besides doing it automaticalliy for you whenever it

Re: [sqlite] EXTERNAL:Re: EXTERNAL: why is this table locked?

2010-07-11 Thread Black, Michael (IS)
Oops -- sorry guys...I got a little click-happy...not enough caffeine yet... Michael D. Black Senior Scientist Northrop Grumman Mission Systems ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] EXTERNAL: why is this table locked?

2010-07-11 Thread Black, Michael (IS)
Version 1.44 checked in. I also added a setDatabaseFile(char *) and getDatabaseFile() just now complete the file name set. cluster = new Cluster(); cluster->setDatabaseFile("cluster.db"); cluster->dbDelete(); cluster->setHistoFile("histo.csv");

Re: [sqlite] EXTERNAL: concat 2 const chars ?

2010-07-09 Thread Black, Michael (IS)
You must be thinking of Java or such -- C doesn't do concatenation that way. There is a strcat() function but that's an ugly way to do it. Here's how I'd do it: int language=6; int nbytes; char sql[65535]; // big sql buffer to store whatever we need nbytes=snprintf(sql,sizeof(sql),"SELECT

Re: [sqlite] EXTERNAL:Re: EXTERNAL: setup sqlite in vc++

2010-07-08 Thread Black, Michael (IS)
: [sqlite] EXTERNAL:Re: EXTERNAL: setup sqlite in vc++ Here is my email address fixed-term.seak.meng...@us.bosch.com Thanks Black, Michael (IS) wrote: > > I've got Visual Express 2008 C++ -- I made a Win32 console application and > compiled this just fine. > > If you want to

Re: [sqlite] EXTERNAL:Re: EXTERNAL: setup sqlite in vc++

2010-07-07 Thread Black, Michael (IS)
I've got Visual Express 2008 C++ -- I made a Win32 console application and compiled this just fine. If you want to send your email address I'll email you the project and you can try it on the non-Express version. Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] EXTERNAL: sqlite3_step returns sqlite_busy

2010-07-07 Thread Black, Michael (IS)
Of course it's possible -- multiple clients accesing the database is just fine. Is there any reason you need exclusive access for each thread in ping-pong mode? If not, just handle the BUSY in both places. Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] EXTERNAL: compile sqlite with Visual Studio 6

2010-07-07 Thread Black, Michael (IS)
Didn't we just answer this or similar? Download the amalgamation and include sqlite3.c in your project. You can put whatever switches you want on it. http://www.sqlite.org/download.html Michael D. Black Senior Scientist Northrop Grumman Mission Systems

Re: [sqlite] EXTERNAL:Re: EXTERNAL: setup sqlite in vc++

2010-07-07 Thread Black, Michael (IS)
3_open > referenced in function _main > 1>C:\Documents and Settings\My Documents\Visual Studio > 2008\Projects\TestSqlite\Debug\TestSqlite.exe : fatal error LNK1120: 4 > unresolved externals > > Any ideas what I did wrong? > > Thanks > > > Black, Michael (IS) wrote

Re: [sqlite] EXTERNAL: setup sqlite in vc++

2010-07-06 Thread Black, Michael (IS)
You don't need C++ wrappers...just code in C. There's lots more C examples out there than C++. Easiest way for me to integrate is to download the amalgamation and include it as a source file in your project. The amalgamzation is at the top of the download page:

Re: [sqlite] EXTERNAL: Reg: In Memory Database Using SQLite

2010-07-06 Thread Black, Michael (IS)
When you say "send it" do you mean you can mount the server file system? If so, just attach a database table on the server and copy your database over to it. The server can then copy it into memory. You just need some sort of notification method (like a table with a boolean) to show who has

Re: [sqlite] EXTERNAL: WAL - Performance/fsync

2010-07-06 Thread Black, Michael (IS)
You'll find a LARGE performance improvement if you wrap your inserts inside a BEGIN/COMMIT and only commit every 1000 or so inserts or such. BEGIN for all records INSERT count++ if ((count % 1000)==0) COMMIT;BEGIN // commit and begin again end COMMIT Michael D. Black Senior

Re: [sqlite] EXTERNAL:Re: How to select an entry that appears <=n times and only show n times if it appears more than n times?

2010-07-02 Thread Black, Michael (IS)
I don't know about anybody else but I can't tell what you want to do. Have you got some sample data and the results you expect from it? Michael D. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org on behalf of

Re: [sqlite] EXTERNAL: Bug with commandline option -csv and -separator

2010-07-02 Thread Black, Michael (IS)
I think "-csv" is, in essence, just a shorthand for "-separator ," So in your first example you override it your semicolon with the -csv option. Not a bug at all unless you think it should warn you every time you change the separator (which would seem a bit much). Michael D. Black

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

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: sqlite-users-boun...@sqlite.org on behalf of Dr. David Kirkby Sent: Thu 6/24/2010 10:10 AM To: General Discussion of

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:

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

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

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: sqlite-users-boun...@sqlite.org on behalf of Glen

Re: [sqlite] SELECT behaviour with INDEX

2010-06-17 Thread Black, Michael (IS)
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) <michael.bla...@n

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)
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] Mail loop?

2010-06-14 Thread Black, Michael (IS)
r Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org 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

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
ission Systems From: sqlite-users-boun...@sqlite.org 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) <michael.bla...@ngc.c

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
: sqlite-users-boun...@sqlite.org 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) <michael.bla...@ngc.com > wrote: > The problem is that somebody has a

Re: [sqlite] Mail loop?

2010-06-14 Thread Black, Michael (IS)
: sqlite-users-boun...@sqlite.org 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, Michael

[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

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:

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

2010-06-11 Thread Black, Michael (IS)
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 > file? Try to make file -rw-rw-rw-. Pavel On F

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

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

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

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 *

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

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

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] 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

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

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: sqlite-users-boun...@sqlite.org on behalf of Michael Ash Sent: Fri 5/28/2010 9:57 AM To:

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.

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

2010-05-27 Thread Black, Michael (IS)
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) wrote: > > So only do N many r

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;

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

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: sqlite-users-boun...@sqlite.org on behalf of Simon Slavin Sent: Wed 5/26/2010 12:25 PM To:

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

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: sqlite-users-boun...@sqlite.org on

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

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: sqlite-users-boun...@sqlite.org on behalf of Art Sent: Mon 5/24/2010 1:28 PM To:

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;

Re: [sqlite] UTF16 - sqlite3_prepare16_v2

2010-05-22 Thread Black, Michael (IS)
h 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 mistake of thinking that the entire SQL > strin

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

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

2010-05-21 Thread Black, Michael (IS)
. Black Senior Scientist Northrop Grumman Mission Systems From: sqlite-users-boun...@sqlite.org 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 statically

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: sqlite-users-boun...@sqlite.org on behalf of Black, Michael (IS) Sent: Fri 5

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

2010-05-21 Thread Black, Michael (IS)
-boun...@sqlite.org on behalf of Gilles Ganault Sent: Fri 5/21/2010 6:41 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] What languages can include SQLite statically? On Fri, 21 May 2010 06:28:20 -0500, "Black, Michael (IS)" <michael.bla...@ngc.com> wrote: >It looks like Fr

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] SQLite file Validation

2010-05-19 Thread Black, Michael (IS)
From: sqlite-users-boun...@sqlite.org 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 your o

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

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

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:

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

2010-05-19 Thread Black, Michael (IS)
about 10ms IIRC). Pavel On Tue, May 18, 2010 at 1:50 PM, Black, Michael (IS) <michael.bla...@ngc.com> 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 inst

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

2010-05-18 Thread Black, Michael (IS)
an Mission Systems ________ From: sqlite-users-boun...@sqlite.org on behalf of Jay A. Kreibich Sent: Tue 5/18/2010 2:12 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] read only databases and in-memory databases On Tue, May 18, 2010 at 12:50:20PM

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

2010-05-18 Thread Black, Michael (IS)
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) <michael.bla...@ngc.com> wrote: > Actually I wonder if the sqlite3 mutex call

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

2010-05-18 Thread Black, Michael (IS)
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 arrived in, you

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

2010-05-18 Thread Black, Michael (IS)
...@sqlite.org 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) <michael.bla...@ngc.com > wrote: > I think I see a potentia

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

2010-05-18 Thread Black, Michael (IS)
: 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) <michael.bla...@ngc.com > wrote: > Not rude -- just a communications problem... > > There's a difference between read-onl

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

2010-05-17 Thread Black, Michael (IS)
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) < michael.bla...@ngc.com> wrote: > By "breakdown in communications" you must mean lost data or incomplete > result

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

2010-05-17 Thread Black, Michael (IS)
alf 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) <michael.bla...@ngc.com > wrote: > Well...you don't say what "problem&qu

<    3   4   5   6   7   8   9   >