Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Black, Michael (IS)
reibich [j...@kreibi.ch] Sent: Wednesday, April 18, 2012 10:32 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework On Wed, Apr 18, 2012 at 01:20:59PM +, Black, Michael (IS) scratched on the wall: > default v

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Black, Michael (IS)
default values are during INSERT...not SELECT. I suppose it's possible Maestro is messing it up. You just need to do an "update mytable set IsReplaced=0 where IsReplaced is null;" You can do that from the shell. Hopefully that makes your ADO happy. If you want to test the shell then

Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with entityframework

2012-04-18 Thread Black, Michael (IS)
Have you checked your table afterwords to ensure you don't have any nulls in IsReplaced? select count(IsReplaced) from mytable where IsReplaced is null; I tested and the alter table does fill with default values for me. At least from the sqlite shell. Does this work for you? Are you

Re: [sqlite] Time zones

2012-04-17 Thread Black, Michael (IS)
You're talking PHP...not SQLite. SQLite doesn't know about timezones other than "local" and "utc". So your timezones will depend on your OS. On RedHat it's in /usr/share/zoneinfo and there's tons of them. I've got 1,743 of them. Michael D. Black Senior Scientist Advanced

Re: [sqlite] Slightly unexpected behaviour when comparing date and datetime

2012-04-17 Thread Black, Michael (IS)
Store them as float or do integer and multiple by a power of 10 to get as many digits as you want. So 1.234 seconds *10^3 can be 1234 integer Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information

Re: [sqlite] error compilation with Sqlite in C program

2012-04-12 Thread Black, Michael (IS)
.org [mailto:sqlite-users-boun...@sqlite.org] De la part de Black, Michael (IS) Envoyé : jeudi 12 avril 2012 17:17 À : General Discussion of SQLite Database Objet : Re: [sqlite] error compilation with Sqlite in C program You're missing a step in your library build. ranlib libsqlite.a Michae

Re: [sqlite] error compilation with Sqlite in C program

2012-04-12 Thread Black, Michael (IS)
You're missing a step in your library build. ranlib libsqlite.a Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Using "attach database" to work around DB locking

2012-04-11 Thread Black, Michael (IS)
I assume you are batching your inserts? How many inserts/sec do you need to do to keep up? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From:

Re: [sqlite] error compilation with sqlite amalgamation

2012-04-11 Thread Black, Michael (IS)
e : sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] De la part de Black, Michael (IS) Envoyé : mercredi 11 avril 2012 14:01 À : General Discussion of SQLite Database Objet : Re: [sqlite] error compilation with sqlite amalgamation You don't show how you're compiling...but thi

Re: [sqlite] error compilation with sqlite amalgamation

2012-04-11 Thread Black, Michael (IS)
You don't show how you're compiling...but this is what you need to do. gcc -o myprog myprog.c sqlite3.c -lthread -ldl Your undefined reference are to the two libraries you need to link in to resolve them. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced

Re: [sqlite] case where sqlite3_prepare_v2 returns OK and sets stmt to NULL

2012-04-09 Thread Black, Michael (IS)
You want your assert to be this: assert(stmt != NULL); Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org

Re: [sqlite] undefined symbol: sqlite3_stricmp

2012-04-08 Thread Black, Michael (IS)
Don't you need to load the sqlite3 library first for tclsh? load ./libtclsqlite3.so Sqlite3 Or something like that? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems

Re: [sqlite] Variation on INSERT with SELECT issue

2012-04-05 Thread Black, Michael (IS)
You need 2 inserts to do what you want. Hopefully the order in the table doesn't matter to you. sqlite> CREATE TABLE t2 (Col1 text,Col2 text); sqlite> insert into t2 (Col1) values('xxx'); sqlite> insert into t2 values('yyy','def'); sqlite> select * from t2; xxx| yyy|def sqlite> sqlite>

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-04 Thread Black, Michael (IS)
Howeverthe DB file is portable across big/little endian and 32/64 bit. So do your hash on the DB file and distribute that. Any reason you can't do that? http://www.sqlite.org/onefile.html I guess SQLite uses the endianess of the database file over the architecture? Michael D.

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-03 Thread Black, Michael (IS)
Database files are purportedly platform independent. So why don't you distribute the database file instead of building it? Then your checksum would be fine. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman

Re: [sqlite] about sqlite3_exec function

2012-03-31 Thread Black, Michael (IS)
lite.org] on behalf of Simon Slavin [slav...@bigfraud.org] Sent: Saturday, March 31, 2012 7:50 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] about sqlite3_exec function On 31 Mar 2012, at 12:48pm, "Black, Michael (IS)" <michael.bla...@ngc.com> wrote: &

Re: [sqlite] about sqlite3_exec function

2012-03-31 Thread Black, Michael (IS)
What you want is the system() function which will execute a shell command. But you still need to add your own HTML around it to be displayed by a browser as it's missing the "rest of the story". system("echo >mm.html"); // first one creates mm.html system("echo >>mm.html"); // 2nd and

Re: [sqlite] how to add time in a new column

2012-03-29 Thread Black, Michael (IS)
You'll need to export the table and data. Change the SQL to what you want. Then import again. Does the shell have ability to name the columns on the insert statements from the .dump to make this easier? I don' t see anythinig offhand that seems to do that. Michael D. Black Senior

Re: [sqlite] memory handling problems in 3.710 - 3.7.11

2012-03-27 Thread Black, Michael (IS)
Don't see any problems here with valgrind. Red Hat Enterprise Linux Server release 5.7 (Tikanga) [sqlite-amalgamation-3071100]$ gcc -g -o shell shell.c sqlite3.c -ldl -lpthread [sqlite-amalgamation-3071100]$ ./shell SQLite version 3.7.11 2012-03-20 11:35:50 Enter ".help" for instructions

Re: [sqlite] 64-bit Windows Command Shell

2012-03-26 Thread Black, Michael (IS)
e work could get done? > > > > Thanks ! > > > > On Wed, Mar 21, 2012 at 12:26 PM, Roger Binns <rog...@rogerbinns.com> > > wrote: > > > > > -BEGIN PGP SIGNED MESSAGE- > > > Hash: SHA1 > > > > > > On 21/03/12 11:09, Black, M

Re: [sqlite] 64-bit Windows Command Shell

2012-03-21 Thread Black, Michael (IS)
Cache is the primary (and obvious) thing I can think of. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Optimize Table Access Efficiency

2012-03-20 Thread Black, Michael (IS)
Tim On 3/20/2012 10:26 AM, Black, Michael (IS) wrote: > Try creating 2 tables, one for topics, one for definitions. > > > > Then insert all the topics at once followed by all the definitions. > > That should give you the same disk layout as two databases. >

Re: [sqlite] Optimize Table Access Efficiency

2012-03-20 Thread Black, Michael (IS)
Try creating 2 tables, one for topics, one for definitions. Then insert all the topics at once followed by all the definitions. That should give you the same disk layout as two databases. And you don't say what "lengthy" means. Michael D. Black Senior Scientist Advanced Analytics

Re: [sqlite] EXT : Sqlite error message

2012-03-15 Thread Black, Michael (IS)
Put an absolute path name for your filename. You're probably opening up the database in the wrong directory, creating an empty DB, and thus "no such table". In particular this happens when running from the IDE or via an Icon where the working directory is not set. Michael D. Black Senior

Re: [sqlite] SIGBUS error in case of disk full with WAL mode

2012-03-08 Thread Black, Michael (IS)
:45 AM, Black, Michael (IS) <michael.bla...@ngc.com > wrote: > Looks like this should work... > No, it won't work. The memory has to be shared in common among all connections to a particular database. If two separate processes connection to the same database, they must get the same blo

Re: [sqlite] SIGBUS error in case of disk full with WAL mode

2012-03-08 Thread Black, Michael (IS)
Looks like this should work... >From http://www.cs.cf.ac.uk/Dave/C/node27.html The following code fragment demonstrates a use of this to create a block of scratch storage in a program, at an address that the system chooses.: int fd; caddr_t result; if ((fd = open("/dev/zero", O_RDWR)) ==

Re: [sqlite] Efficient random sampling in a large table using builtin functions.

2012-03-08 Thread Black, Michael (IS)
[simon.james.dav...@gmail.com] Sent: Thursday, March 08, 2012 8:47 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Efficient random sampling in a large table using builtin functions. On 8 March 2012 14:37, Black, Michael (IS) <michael.bla...@ngc.com> wrote: > Gla

Re: [sqlite] Efficient random sampling in a large table using builtin functions.

2012-03-08 Thread Black, Michael (IS)
] Efficient random sampling in a large table using builtin functions. On 8 March 2012 14:20, Black, Michael (IS) <michael.bla...@ngc.com> wrote: > You don't say what language you are working in. IN C++ I would just declare > a "set" and put random row numbers in it until I

Re: [sqlite] Efficient random sampling in a large table using builtin functions.

2012-03-08 Thread Black, Michael (IS)
You don't say what language you are working in. IN C++ I would just declare a "set" and put random row numbers in it until I had enough. Then use that set to build the SQL. SQLite's random() doesn't have a seed function so you don't really get very random numbers from run-to-run and have

Re: [sqlite] TEXT PRIMARY KEY

2012-03-02 Thread Black, Michael (IS)
Hmmm...works for me... On Windows: SQLite version 3.7.9 2011-11-01 00:52:41 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table test(a text primary key); sqlite> insert into test values('1'); sqlite> insert into test values('1'); Error: column a is

[sqlite] RE SELECT average timestamp to get average time of day?

2012-02-25 Thread Black, Michael (IS)
I subtract 12 hours...so any time from 24:00:00 to 12:00:00 will work. Time from noon to noon becomes midnight to midnight. Then you just add the 12 hours back in. CREATE TABLE tijd(t int(11)); INSERT INTO "tijd" VALUES('2012-02-25 22:00:00'); INSERT INTO "tijd" VALUES('2012-02-27

Re: [sqlite] sqlite3 windows command line: writing the sql errors to a file (and not to the screen)

2012-02-14 Thread Black, Michael (IS)
type dbscript.sql | sqlite3 test.db3 > dbscript.log 2>&1 And order is importantyou need to redirect to file first and then redirect stderr to stdout as above. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman

Re: [sqlite] Compiling SQLite3 to run on Windows Mobile 6.5

2012-02-11 Thread Black, Michael (IS)
bat @del /q %~n1.csv @if not exist %1 echo No such file: %1 @echo .separator "," >grocery.sql @echo .output %~n1.csv >>grocery.sql @echo select * from grocery; >>grocery.sql @echo .quit >>grocery.sql @sqlite3 %1 mailto:sqlite-users-boun...@sqlite.org] On Behalf Of

Re: [sqlite] Compiling SQLite3 to run on Windows Mobile 6.5

2012-02-09 Thread Black, Michael (IS)
Let's change them a touch...one too many @'s in loop.bat loop.bat @for %%i in (%1) do @call dump %%i dump.bat @echo .separator "," >grocery.sql @echo .output %~n1.csv >>grocery.sql @echo select * from grocery; >>grocery.sql @echo .quit >>grocery.sql @sqlite3 %1 grocery.sql echo .output

Re: [sqlite] Cannot insert/retrieve 8 byte integers without losing digits

2012-02-09 Thread Black, Michael (IS)
Is this from inside your application? Works fine from the shell which makes me think you're truncating your value in your program. SQLite version 3.7.9 2011-11-01 00:52:41 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> CREATE TABLE IF NOT EXISTS Exports

Re: [sqlite] .output Question

2012-02-09 Thread Black, Michael (IS)
>> test2.csv Test3.db >> test3.csv .separator "," .output "orginal DB file name" + .csv select * from grocery; .quit -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: Th

Re: [sqlite] Inserts get slower and slower

2012-02-09 Thread Black, Michael (IS)
I think you may find you're running into buffer cache limits (not sqlite but OS limits). So the 1st third all fits into buffer cache. Once it starts committing to disk things slow down a LOT. Since you're not showing an real times it's hard to say you are any slower than anybody else.

Re: [sqlite] sqlite] .output Question

2012-02-09 Thread Black, Michael (IS)
echo .separator "," >grocery.sql echo .output %filename% >>grocery.sql echo select * from grocery; >>grocery.sql echo .quit >>grocery.sql sqlite3 grocery.db http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list

Re: [sqlite] RE Connect As400/Iseries to SQLite .db

2012-02-08 Thread Black, Michael (IS)
sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: Wednesday, February 08, 2012 11:47 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] RE Connect As400/Iseries to SQLite .db Do you have a C compiler on the AS400 you can use? I couldn't find any

Re: [sqlite] RE Connect As400/Iseries to SQLite .db

2012-02-08 Thread Black, Michael (IS)
. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: Wednesday, February 08, 2012 11:09 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] RE Connect As400/Iseries to SQLite .db Yesjust use

Re: [sqlite] RE Connect As400/Iseries to SQLite .db

2012-02-08 Thread Black, Michael (IS)
on an as400? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS) Sent: Wednesday, February 08, 2012 10:46 AM To: General Discussion of SQLite Database Subject: [sqlite] RE Connect As400/Iseries to SQLite .db Any reason

[sqlite] RE Connect As400/Iseries to SQLite .db

2012-02-08 Thread Black, Michael (IS)
Any reason you can't just .dump your SQLite database and import into db2? Or do you need an ongoing connection? There's a guy in this thread that connected his Linux system to AS400 using PHP but the .dump/import would be a lot easier. http://php.net/manual/en/function.odbc-connect.php

Re: [sqlite] ALTER TABLE

2012-02-06 Thread Black, Michael (IS)
Hmmmcould .dump also have the ability to put out the column names for the inserts? That would solve this problem without having to write a special program to do it yourself. I suppose somebody might already have made a utility to do this? Michael D. Black Senior Scientist Advanced

Re: [sqlite] Re; update problem

2012-02-04 Thread Black, Michael (IS)
I think I found your problem. Change self.con.commit To self.con.commit() In your Fupdate function sqlite> .dump PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE abc800_111__FIRST (pink varchar,

Re: [sqlite] Re; update problem

2012-02-04 Thread Black, Michael (IS)
I don't know python for squatso this is what I get with your codewhat do you expect? ./py abc800_111__FIRST ## tablename sql_test 24 ## locate sql_test 34 [] ## Rcount sql_test 69 ['abc', '800 111 ', 'FIRST'] ## vRecordKey sql_test 97 [(u'1)No Row Name',)] ## divcolinfo

Re: [sqlite] EXT :Re: Tracking error 11 : database disk image is malformed.

2012-02-03 Thread Black, Michael (IS)
When you say "flash" and "JFFS" and "years" I think "life cycle". You may be hitting the wall. http://www.chuckstr89134.com/newsltrs/015.htm Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems

Re: [sqlite] support of %y in strftime()

2012-02-03 Thread Black, Michael (IS)
Non-standard ISO formatalready doable like this: sqlite> select substr(strftime("%Y",'now'),3,2); 12 This will work until the year 10,000 :-) Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information

Re: [sqlite] A simple calculation, complex SQL Statement

2012-01-31 Thread Black, Michael (IS)
CREATE TABLE tblMainInventory(id,q); INSERT INTO "tblMainInventory" VALUES(1,40); INSERT INTO "tblMainInventory" VALUES(2,50); CREATE TABLE tblSales(id,q); INSERT INTO "tblSales" VALUES(1,30); INSERT INTO "tblSales" VALUES(2,20); CREATE TABLE tblReceives(id,q); INSERT INTO "tblReceives"

Re: [sqlite] Database is Locked

2012-01-29 Thread Black, Michael (IS)
, no shell no fuser. Shahar. 2012/1/29 Black, Michael (IS) <michael.bla...@ngc.com> > Do you have shell access I hope? > > > > Check out "fuser" and see if you can find a process attached to it. > > > > Michael D. Black > > Senior Scientist >

Re: [sqlite] Database is Locked

2012-01-29 Thread Black, Michael (IS)
Do you have shell access I hope? Check out "fuser" and see if you can find a process attached to it. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From:

Re: [sqlite] Problem with sqlite and codeblocks (mingw)

2012-01-28 Thread Black, Michael (IS)
I don't think you want shell.c in your library. That has a "main" which will conflict. You don't need it anways. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems

Re: [sqlite] [sqlite 3.6.22] database ".dump" function cannot export table of large number of columns < 2000

2012-01-28 Thread Black, Michael (IS)
Without knowing what you're doing with the data or what your asbtract structure is many will asssume that too many columns means not enough "normalization" of your database. It's not SQLite -- it's standard database design. http://en.wikipedia.org/wiki/Database_normalization You may be

Re: [sqlite] EXT : sqlite and boolean type (some problem)

2012-01-25 Thread Black, Michael (IS)
If you do a .dump of your table you will see that your 'true' and 'false' are exactly that -- the strings (and not the boolean values). So yes, there's only one row that has a value 0. The other rows have 1, 'true', and 'false'. As the web page says, use 1 or 0 for true/false. It won't

Re: [sqlite] Incompatible versions of SQLite on same system

2012-01-25 Thread Black, Michael (IS)
Try this utility on both programs and find out what DLL they are actually going for. And remember that if the DLL is already loaded it will use that. http://www.dependencywalker.com/ Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit

Re: [sqlite] C# amalgamation hand holding requested

2012-01-24 Thread Black, Michael (IS)
of System.Data.SQLite.dll that is in the same directory as the executing application. The only time it will not use this version is if you load System.Data.SQLite.dll into the Global Assembly Cache which I do not recommend. On Tue, Jan 24, 2012 at 10:49 AM, Black, Michael (IS) <michael.bla...@ngc.

Re: [sqlite] C# amalgamation hand holding requested

2012-01-24 Thread Black, Michael (IS)
Yes -- you do need to worry. Plusyou apparently should rename the DLL so it doesn't collide with any others from what I can discern from this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx Michael D. Black Senior Scientist Advanced Analytics

Re: [sqlite] Possible Timestamp Where cluase bug

2012-01-23 Thread Black, Michael (IS)
I'm confused as to why you would expect any match at all. And indeed, when I run your queries against a test set I get nothing back at all for both queries. Your datetime formats don't match at all. And "ORDER BY" for that field is not date/time order since you have DD.MM. which won't

Re: [sqlite] Linking a "C" program with SQlite3.DLL

2012-01-22 Thread Black, Michael (IS)
Just add sqlite3.c to your compilation. You likely have no reason to use the DLL. This should work: gcc -O -o test test.c sqlite3.c -ldl -lpthread Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information

Re: [sqlite] Incompatible versions of SQLite on same system

2012-01-16 Thread Black, Michael (IS)
You don't need to "register" the SQLite DLL. That's for ActiveX and COM DLLs. Not ones that just export functions. The search path stuff is a mess under Microsoft. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#standard_search_order_for_desktop_applications

Re: [sqlite] [sqlite-announce] SQLite version 3.7.10

2012-01-16 Thread Black, Michael (IS)
Read here on Mac OS X http://sqlite.org/cvstrac/wiki?p=ReadLine Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org

Re: [sqlite] makefile for c

2012-01-16 Thread Black, Michael (IS)
t; wrote: > >> What is the problem with the shared lib stuff? >> >> Thanks!! >> Black, Michael (IS) wrote, On 1/15/2012 2:27 PM: >>> A simple one -- and please compile sqlite3.c into your program and make >>> everybody happy. >>> >>> Forget th

Re: [sqlite] sqlite3_bind. error as library routine called out of sequence.

2012-01-16 Thread Black, Michael (IS)
You have to do all the binds together, THEN step. This works for me. #include #include #include #include "sqlite3.h" int main() { sqlite3 *db; sqlite3_stmt *stmt; int status; char *create = "create table ONTTable(slotId,ponChannelId,onuType,onuId,adminStatus);"; char

Re: [sqlite] All values of a fields are not stored in the single record.

2012-01-16 Thread Black, Michael (IS)
You did 5 inserts and got 5 records. You need to do either just ONE insert or ONE insert and FOUR updates. I'd got for the one insert. query = "insert into ONTTable (slotId,ponChannelId,onuType,onuId,adminStatus) values (?1,?2,?3,?4,?5);"; then bind each parameter. Michael D. Black

Re: [sqlite] SSD with TRIM

2012-01-16 Thread Black, Michael (IS)
For this particular test cache_size didn't matter much...actually ran a touch faster with smaller cache (although may be within the margin of error) I dropped the cache_size to 125 pages (which matches the 16X increase in page size that I did) On SSD: time sqlite3 gen.db int main () {

Re: [sqlite] SSD with TRIM

2012-01-16 Thread Black, Michael (IS)
On Mon, Jan 16, 2012 at 12:29 AM, Black, Michael (IS) < michael.bla...@ngc.com> wrote: > > On SSD with 16384 page size and no WAL mode: > > time sqlite3 gen.db > real4m4.816s ... > Note: Database is only 595M with this page size. Much more efficient > storage m

Re: [sqlite] SSD with TRIM

2012-01-16 Thread Black, Michael (IS)
your /tmp is actually using disk? It's the default in a lot of setups. Best Peter > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Black, Michael (IS) > Sent: Sunday, January 15, 2012 12:35 PM > To: Gen

Re: [sqlite] SSD with TRIM

2012-01-15 Thread Black, Michael (IS)
I also ran without WAL mode (about 3X slower than WAL mode) On SSD: (system spent a LOT of time in disk wait states) time sqlite3 gen.db wrote: > > Fast. Fasty fast. Speed is high. INSERT, UPDATE, and DELETE all > significantly faster. SELECT is a bit faster, but there's less difference. >

Re: [sqlite] makefile for c

2012-01-15 Thread Black, Michael (IS)
A simple one -- and please compile sqlite3.c into your program and make everybody happy. Forget the shared library stuff as we have just been talking about. CFLAGS=-O OBJECTS=myapp.o sqlite3.o LIBS=-lpthread -ldl myapp: $(OBJECTS) $(CC) -o $@ $(OBJECTS) $(LIBS) Michael D. Black

Re: [sqlite] Incompatible versions of SQLite on same system

2012-01-15 Thread Black, Michael (IS)
My point still standsyou can test the application compatibility by copying the DLL into the app directory and changing the search order as I recommended. Did you try that? The applications really need to compile sqlite in their app. That's the good fix here as has been pointed out (and

Re: [sqlite] SSD with TRIM

2012-01-15 Thread Black, Michael (IS)
I ran your test on my SSD system with 1M inserts. I used WAL mode. pragma journal_mode=WAL; CREATE TABLE [TestTable] ( [Id] INTEGER PRIMARY KEY AUTOINCREMENT, [Text] TEXT ); begin; insert. end; On SSD: time sqlite3 gen.db wrote: > > Fast. Fasty fast. Speed is high. INSERT,

Re: [sqlite] UPSERT again

2012-01-12 Thread Black, Michael (IS)
Come to thihk of it just add another field which is set to the "old" value during the update. Then both fields are available AFTER INSERT. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems

Re: [sqlite] UPSERT again

2012-01-12 Thread Black, Michael (IS)
What if you do a BEFORE INSERT and stick the values in a temporary table (use a matching rowid). Then you can just retrieve in in your AFTER trigger. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information

Re: [sqlite] UPSERT again

2012-01-12 Thread Black, Michael (IS)
Does REPLACE do what you want? http://www.sqlite.org/lang_replace.html Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Incompatible versions of SQLite on same system

2012-01-12 Thread Black, Michael (IS)
Can't you just copy the DLL into the application directory? That just does what the app ought to do (if they don't already). Then you might have to turn off safe DLL mode to find the correct DLL unless you remove the system one.

Re: [sqlite] Curious SQLite performance observation

2012-01-05 Thread Black, Michael (IS)
Sure looks like cache to me. In your slow version you're walking thriugh the entire table twice as opposed to interleaving. You don't say how big your database is. Increasing cache size may solve the problem. pragma cache_size=2000 (default cache size in pages...1024 size pages means

Re: [sqlite] How to sort within a text field

2012-01-05 Thread Black, Michael (IS)
Along with the sortprds code and database I sent out previously this now works. gcc -g -o main main.c -DSQLITE_ENABLE_LOAD_EXTENSION sqlite3.c -lpthread -ldl ./main test.db "select id,sortprds(prdtype) from a order by sortprds(prdtype)" ID = 2 sortprds(prdtype) = 3|10|15|27 ID =

Re: [sqlite] SegV at sqlite3_open() (Was: Re: How to sort within a text field)

2012-01-05 Thread Black, Michael (IS)
Yup...putting the main in a separate file fixed it. Thanks. Or is there some other init function that can be called to maintain it in one file? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information

Re: [sqlite] How to sort within a text field

2012-01-04 Thread Black, Michael (IS)
Your question made me want to do something I've been meaning to for a while...a custom function. So...the following words as loadable extension (at least for the shell) gcc -g -shared -fPIC -o sortprds.sqlext sortprds.c sqlite3 test.db SQLite version 3.7.9 2011-11-01 00:52:41 Enter

Re: [sqlite] Fw: Fw: A question on sqlite processing

2012-01-03 Thread Black, Michael (IS)
Systems From: u okafor [uo07...@yahoo.com] Sent: Monday, January 02, 2012 4:41 PM To: sqlite-users@sqlite.org Cc: Black, Michael (IS); d...@sqlite.org Subject: EXT :Fw: [sqlite] Fw: A question on sqlite processing Is that to say that the 'split on the source file

Re: [sqlite] Fw: A question on sqlite processing

2011-12-30 Thread Black, Michael (IS)
, 2011 at 5:50 PM, Black, Michael (IS) <michael.bla...@ngc.com > wrote: > So can we get a link on the download page for this? > There is a "Download" link on the lower menu bar. (ref: http://www.sqlite.org/src/artifact/d9be87f1c340285a3?ln) -- D. Richar

Re: [sqlite] Fw: A question on sqlite processing

2011-12-30 Thread Black, Michael (IS)
ber 30, 2011 7:41 AM To: General Discussion of SQLite Database Cc: u okafor Subject: EXT :Re: [sqlite] Fw: A question on sqlite processing On Fri, Dec 30, 2011 at 8:17 AM, Black, Michael (IS) <michael.bla...@ngc.com > wrote: > > Nobody has done a split on the source file y

Re: [sqlite] Fw: A question on sqlite processing

2011-12-30 Thread Black, Michael (IS)
This was just answered in another chain. Visual Studio has a 64k limit on source code files for the debugger (thanks Microsoft...a 16-bit limit?...really!). If you need to step into it use WinDbg http://msdn.microsoft.com/en-us/windows/hardware/gg463009 Nobody has done a split on the

Re: [sqlite] 3.7.9 amalgamation file in VS2005

2011-12-29 Thread Black, Michael (IS)
gt; AN> > AN> Thanks > AN> > AN> Alex > AN> __ > >> Od: "Black, Michael (IS)" > >> Komu: General Discussion of SQLite Database > >> Datum: 27.12.2011 23:36 > >> Předm

Re: [sqlite] 3.7.9 amalgamation file in VS2005

2011-12-27 Thread Black, Michael (IS)
I duplicated your problem on C++ 2005 Express and C++ 2008 Express. C++ 2010 Express does the syntax highlighting correctly (or at least a lot better). Can you upgrade? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop

Re: [sqlite] EXT : Optimizing a query with range comparison.

2011-12-27 Thread Black, Michael (IS)
Does this type of insert need a begin/commit around it? And would WAL mode make any difference? And try increasing your cache_size to at least the size of your database file. cache_size is in pages so the default of 2000 is 2MB. #pragma cache_size=20 That'll make it 200MB which is

Re: [sqlite] search

2011-12-27 Thread Black, Michael (IS)
I don't know if FTS or a normal table will matter here but just normalize the whole thing. CREATE VIRTUAL TABLE virfts4 using fts4(id,level,value); Your level can be CO, ST, CI, VI. Or 1,2,3,4. 1,2,3,4 would be a touch faster. INSERT INTO virfts4 VALUES(1,'CO','country1'); INSERT INTO

Re: [sqlite] [shell] utf-8 bug

2011-12-27 Thread Black, Michael (IS)
I"m not a UTF expert but codepage 437 seems to work fine for your example. codepage 65001 is not "real" UTF-8 according to several google sources. You do have to use Lucida font. C:\chcp 437 Active code page: 437 C:\sqlite test.db SQLite version 3.7.9 2011-11-01 00:52:41 Enter ".help"

Re: [sqlite] Sqlite Concurrent access issue

2011-12-22 Thread Black, Michael (IS)
You're probably seeing disk thrashing. Try increasing your database cache size: .pragma cache_size XX It's in kilobytes. Try and make it as big as your database if you can. In other words, cache the whole thing. Secondly, you may want to try using the FTS3/FTS4 search capability if

Re: [sqlite] sqlite3_column_text() returning partial results

2011-12-21 Thread Black, Michael (IS)
What does strlen() tell you on the XML before you put it in the table? Can you boil all this down to one record in a table, and some code so we can all see what's going on? Do a .dump of the table and post the code. See if you can reproduce it in a simple example. Michael D. Black

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread Black, Michael (IS)
Possible causes. #1 You need indexes (quite possible) -- though it appears to me that all the casting is going to kill using indexes. #2 You need to increase cache (likely) -- try "pragam cache_size=200" #3 You're hitting swap space (doubtful) #4 You need to do this in your own code

Re: [sqlite] Need trigger

2011-12-13 Thread Black, Michael (IS)
Works for me CREATE TABLE employee(name text,editby text); CREATE TRIGGER update_editby AFTER INSERT ON employee BEGIN UPDATE employee SET editby = 'unknown' WHERE editby = '' AND rowid = new.rowid; END; INSERT INTO employee VALUES('Ralph',''); SELECT * FROM employee:

Re: [sqlite] Bash Scripting

2011-12-12 Thread Black, Michael (IS)
You need to surround your entire sqlite3 command with back tics. TomaCampo=`sqlite3 /Users/.and RecordTy8pe='R';"` That's how you execute a command in bourne shell. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop

Re: [sqlite] EXT :Re: Poor performance with nested query in outer join

2011-12-12 Thread Black, Michael (IS)
y in outer join "Black, Michael (IS)" <michael.bla...@ngc.com> writes: > Natural joins are generally considered to be evil. Too many columns > in common can be bad. > > If you just spell it out it works as expected > > sqlite> explain query plan select * f

Re: [sqlite] Poor performance with nested query in outer join

2011-12-10 Thread Black, Michael (IS)
Natural joins are generally considered to be evil. Too many columns in common can be bad. If you just spell it out it works as expected sqlite> explain query plan select * from a left join b where a.id=1 and b.id=a.id; 0|0|0|SEARCH TABLE a USING COVERING INDEX sqlite_autoindex_a_1 (id=?)

Re: [sqlite] Strange behavior on SQLite 3.7x compared with 3.6.22

2011-12-08 Thread Black, Michael (IS)
I tested 3.7.9 on both Windows and Linux. Both gave just "31|" as the output instead of "31|0" as you show. And changing the select 9 made no difference...still got the same "31|" answer for both. I'm compiling with default options. Michael D. Black Senior Scientist Advanced

Re: [sqlite] Strange behavior on SQLite 3.7x compared with 3.6.22

2011-12-08 Thread Black, Michael (IS)
Your test_case.sql didn't come thru. Can you report it in-ilne with an email? Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From:

Re: [sqlite] Building Windows applications

2011-12-07 Thread Black, Michael (IS)
Do like a lot of us do and forget the DLL and just put sqlite3.c/h into your project. Then you can build and forget about it and it will always work in your project (barring any future 32/64 incompatibilities). And you don't have to worry about who's testing what bitset as it's completely

Re: [sqlite] import data error message cannot open file

2011-12-06 Thread Black, Michael (IS)
You're seeing on of my pet peeves...error messages like "cannot open file" or Microsoft's famous "cannot load dll". Some of us need to know WHY. So, change all your "cannot open" lines in shell.c to this: fprintf(stderr, "Error: cannot open \"%s\":%s\n", zFile, strerror(errno)); Then

Re: [sqlite] EXT :Re: RE Infinite Loop in MATCH on self written fts3 tokenizer

2011-12-05 Thread Black, Michael (IS)
hi, On Sunday 04 December 2011 14:23:09 Black, Michael (IS) wrote: > It says "here's token 'hal'" and if you return the pointer to "h" it points > to the same place so it returns "hal" right back to youergo the loop. I have read through the ext/fts3/fts3/exp

[sqlite] RE Infinite Loop in MATCH on self written fts3 tokenizer

2011-12-04 Thread Black, Michael (IS)
Because tokenizers expect the pointer to increment and you're apparently not doing that. It says "here's token 'hal'" and if you return the pointer to "h" it points to the same place so it returns "hal" right back to youergo the loop. I think you would have to maintain state and your

<    1   2   3   4   5   6   7   8   9   >