Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
You're welcome to try of course, but it seems like a lot of work for little return when there are other ways to do what you want. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
ase file will be locked, so readers will have to wait. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
accepts commands from, and passes the results back to, your other threads as John suggested. You will have to provide some form of resource management for the shared resource, whether it is a shared memory database, file, or something else. HTH Dennis Cote ___

Re: [sqlite] logging statements executed by the db

2008-04-18 Thread Dennis Cote
ecuted. Your callback can log this to a file. See http://www.sqlite.org/c3ref/profile.html for more info. One drawback of this technique is that you don't get to see the values of any bound parameters. HTH Dennis Cote ___ sqlite-users mailing list sqlite

Re: [sqlite] cidr data type

2008-04-18 Thread Dennis Cote
ng bit manipulation operators in SQL or in a custom function in C. containedIn(ip_addr, network_addr, network_size) can be replaced by nework_addr == (ip_addr & (-1 << network_size)) which will be true if the IP address is in the network. This can be done in a custom function as wel

Re: [sqlite] logging statements executed by the db

2008-04-18 Thread Dennis Cote
ptible to breaking the application if it write back to the table. > I believe a while back, IIRC, someone (perhaps Richard himself) had > posted a way to log every action on a db in a table for posterity. I > can't find that right now, but that could work for me. > The undo/redo code

Re: [sqlite] cidr data type

2008-04-20 Thread Dennis Cote
in other languages. This was intended to work for IPv4 addresses only as shown in the OP example. For these addresses the practical range of network width is from 2, not really very practical, but a legal minimum subnet width, to 25, the entire range of a class A network. De

Re: [sqlite] cidr data type

2008-04-20 Thread Dennis Cote
eturn the host address within the network which can't be used to test if the original IP address is within a particular network. > Again, that only works for v4. > It was only intended to work for IPv4 as shown in the OP. Dennis Cote __

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread Dennis Cote
James Gregurich wrote: > I think I will go with CoreData on MacOSX and figure out something > else to do on Windows later. > > > You do know that CoreData uses SQLite for its persistant storage. Dennis Cote ___ sqlite-users mail

Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread Dennis Cote
ITE_OMIT_yyy ... > > Is this correct? > I believe so, but I haven't ever used the OMIT options when building SQLite. Are you having a problem when you do this? Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Update in one process and Select in another (dumb question??)

2008-04-21 Thread Dennis Cote
here? Tried to do a commit but that doesn't seem to > work either. > If you post the code you are using to read and write the database someone will be able to help you straighten this out. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Blob truncation

2008-04-23 Thread Dennis Cote
device) you can then set the size of the blob correctly before you start writing to it. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Blob truncation

2008-04-24 Thread Dennis Cote
ly change the size by replacing one blob with another one of a different size. > Is it possible to store the file in a bigger > blob and then replace the blob with smaller one without to copy the raw blob > data? > No, when you replace a blob you will need to copy the data in

Re: [sqlite] How to execute the statment file using sqlite API

2008-04-24 Thread Dennis Cote
ite library, so they cannot be used by your application. If you are using the sqlite3 shell, you can use the .read command to execute all the commands in a file. sqlite>.read getData.sql HTH Dennis Cote ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Performance statistics?

2008-04-25 Thread Dennis Cote
easures the execution time of each SQL statement to help you optimize your SQL. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] View bindings for a statement

2008-04-25 Thread Dennis Cote
= ?3 You can prepare a select like this select ?1, ?2, ?3 and then transfer the bindings from the first select to the second. When you run the second query it will return the values you bound to the first query before calling sqlite3_transfer_bindings(). HTH Dennis Cote ___

Re: [sqlite] One connection with 2 statement handle.

2008-04-28 Thread Dennis Cote
Joanne Pham wrote: > So one connection is used by two multiple statements concurrently one for > insertion and one for selection. Is that ok. > Yes, that's fine. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org htt

Re: [sqlite] Recommended (Windows/Linux) SQLite utilities

2008-04-30 Thread Dennis Cote
dd-on for Firefox at https://addons.mozilla.org/en-US/firefox/addon/5817. It seems to work quite well in my testing. Its nice to have the same interface on multiple platforms if you switch back and forth often. HTH Dennis Cote ___ sqlite-users mai

[sqlite] how is sqlitedll-3.5.8.zip built?

2008-04-30 Thread Dennis Cote
. Is that correct? If so, what options are defined when it is being built? If not, how is it built? TIA Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] make import not abort

2008-04-30 Thread Dennis Cote
ant to replace any existing records in t_real you could use an insert or replace instead. insert or replace into t_real select * from t_temp; HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] property/config file for SQLite

2008-05-02 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > Is there a way to configure SQLite using a property/config file? > Is changing the source code the only way to affect how it behaves? > It would probably be better if you were a little more specific. What part of its behavior do you want to change? De

Re: [sqlite] database always locked

2008-05-05 Thread Dennis Cote
uot; statement (but it should not cause a problem either). HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sorting records in random order

2008-05-07 Thread Dennis Cote
Lock 0 2 0 t 00 29Goto 0 3 000 sqlite> Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sorting records in random order

2008-05-08 Thread Dennis Cote
ble then you may be able to use some of these ideas to speed things up. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-14 Thread Dennis Cote
ther threads. http://en.wikipedia.org/wiki/Thread_hijacking What is the schema of Carimages table? Can you provide a couple of sample records instead of the entire database? Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite version 3.5.9

2008-05-14 Thread Dennis Cote
would try benchmark tests with page sizes of 8K and 32K to see if there is a substantial difference. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-15 Thread Dennis Cote
ane Long null, Primary Key (CarID) ); SQLite does accept the table definition as you have it written without any error messages, but it does not agree with the documentation. So there is either an error in the documentation or in the parser. You ma

Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-15 Thread Dennis Cote
gt; You are correct, it should not crash. That's why it is important to get a copy of the database that is causing the problem so that it can be used to find the bug. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://s

Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-22 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > The attachment size limitation of the bug report is 100k :( I'm sorry about the late follow up, but I have been away for a while. Can you contact me off list to see about transferring the compressed database so I can use it to look into the problem? Den

Re: [sqlite] interrupting sqlite3_prepare_v2

2008-05-22 Thread Dennis Cote
do so if you have the time. If you locate a bug it will help all users of SQLite. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Limitation of sqlite3_last_insert_rowid()

2008-05-22 Thread Dennis Cote
lue with no mutual exclusion provided by SQLite. You can of course use your own mutex to control access to this variable (through the API function), to allow your threads to read the value reliably after an insert. Or you could simply have each thread use a separate connection

Re: [sqlite] FTS3 Question

2008-05-22 Thread Dennis Cote
') FROM category); > This function already exists, and is included in SQLite. It is called group_concat(). See http://www.sqlite.org/lang_aggfunc.html for details. SELECT guid FROM data WHERE text MATCH (SELECT group_concat(query, ' OR ') FROM category); HTH Dennis C

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-22 Thread Dennis Cote
is a much better approach, there is a partial answer to your question. SQLite provides the sqlite3_mprintf() function and it's associated %q and %Q format specifiers for quoting SQL strings. See http://www.sqlite.org/c3ref/mprintf.html for details. I'm not sure if this

Re: [sqlite] SQLITE_ENABLE_FTS3

2008-05-22 Thread Dennis Cote
r command line by adding this option to the command -DSQLITE_ENABLE_FTS3 Or you can add the definition to your IDE's project options file. I'm not sure how to do this with VS 2005, but you can probably find it in the help for additional compiler definitions. HTH Dennis Cote __

Re: [sqlite] baffling performance decrease across network (specific case)

2008-05-22 Thread Dennis Cote
no longer do this and subsequently slows down to the real speed of remote file access. See http://en.wikipedia.org/wiki/Opportunistic_Locking for additional info. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] do someone know? DotGnu

2008-05-22 Thread Dennis Cote
ers at http://www.sqlite.org/cvstrac/wiki?p=SqliteOdbc which may work for you as well. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] last_insert_rowid reproducible bug with triggers and FTS2 and 3

2008-05-22 Thread Dennis Cote
think both Richard and Scott may have misread this one a little bit. It seems to me that all the operations Bram has done are using the normal (i.e. non-virtual table) table, one. All the accesses of the virtual table search are done inside the trigger routines. SQLite is suppose

Re: [sqlite] Bind arguments for insert and not null columns with default values

2008-05-22 Thread Dennis Cote
use the default value. If you have lots of fields that you want to do this with the required number of combinations can get large very quickly, so you may be better off building the statements on the fly. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] last_insert_rowid reproducible bug with triggers and FTS2 and 3

2008-05-22 Thread Dennis Cote
nless the lastrowid and nchanges values are saved and restored around the xCommit calls that happen when the active transaction ends. Would that be a possible solution? Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Cross compiling sqlite3.c, anamolies.

2008-05-28 Thread Dennis Cote
C++ to avoid extraneous errors. > I know C, but not a hardcore C programmer.And is working with VC++ for > last 6 years (MFC and ATL) . > You don't need to program in C to use SQLite. There are wrappers for most languages and many frameworks. HTH Dennis Cote

Re: [sqlite] How to add a column with CURRENT_DATETIME?

2008-05-28 Thread Dennis Cote
-bin/mailman/listinfo/sqlite-users > You need to use CURRENT_TIMESTAMP as shown at http://www.sqlite.org/lang_createtable.html HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to add a column with CURRENT_DATETIME?

2008-05-28 Thread Dennis Cote
tibility but perhaps this could be considered for the upcoming 3.6 series. This change would provide for smaller database files, since the integer and real formats are normally smaller than the string they encode, and faster default inserts, since they don't require executing the time and

Re: [sqlite] Corrupted sqlite_sequence table

2008-06-02 Thread Dennis Cote
://www.sqlite.org/cvstrac/tktview?tn=3148 for details. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Forming a query with BLOB with null characters

2008-06-03 Thread Dennis Cote
store it internally. I know sqlite treats blob > and text the same, but is there no way that I can get the binary data as > I have? Do I again need to convert the hex string into my binary blob > buffer? > You would really be much better off using bound parameters and the C API func

Re: [sqlite] Bind arguments for insert and not null columns with default values

2008-06-03 Thread Dennis Cote
and without a value for the column that is to get the default value. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] About dumping a memory DB to a file

2008-06-04 Thread Dennis Cote
database. This is what the ssqlite3 shell's .dump command does. You can copy the source for that function (it's public domain open source after all). Doing this you would execute the script to populate the memory database on startup, and dump the database to a n

Re: [sqlite] how to save an information + Date in SQlite db?

2008-06-04 Thread Dennis Cote
out a server. Any hints how > to orgenice the DB and the request? SQLite can do everything you want to do. It sounds to me like you need to read a basic tutorial on SQL before you start. Try a google search for SQL tutorial. Dennis Cote ___ sqlite-use

Re: [sqlite] What is quicker?

2008-06-04 Thread Dennis Cote
gt; Union > select * from Level2 > Union > select * from Level3 > WHERE class_dds>6 AND (longitude_DDS>6.765103 and > longitude_dds<7.089129) AND (latitude_DDS>44.261771 and > latitude_dds<44.424779) ORDER BY class_dds ASC Limit 20 > > Would that be quicker eventually? > I can't see how this would help. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] What is quicker?

2008-06-04 Thread Dennis Cote
0; -- a further simplification of the general case that removes -- redundant terms select * from City where id in ( select id from CityLoc where (lat_min < :max_lat and lat_max > :min_lat) and (long_min &l

Re: [sqlite] What is quicker?

2008-06-04 Thread Dennis Cote
are completely inside the selection rectangle. The outer select does the work of applying the other constraints, ordering, etc. I see now that this optimized where condition also correctly handles the single point special case (i.e. where lat_min = lat_max and long_min = long_max, a

Re: [sqlite] What is quicker?

2008-06-04 Thread Dennis Cote
m cities join citylookup on citylookup.id = cities.id where cities.id in ( select id from citylookup as c where c.longitude_min>-45.00 and c.longitude_max<45.00 and c.latitude_min>-45.110502 and c.latitude_max<44.889498

Re: [sqlite] Interruption

2008-06-05 Thread Dennis Cote
Hildemaro Carrasquel wrote: > > Is there any function that i can make event when a data change? > No. It is best to have the program that makes the change also generate the event. HTH Dennis Cote ___ sqlite-users mailing list sql

Re: [sqlite] What is quicker?

2008-06-06 Thread Dennis Cote
er way to say not equal) as it was originally documented. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] What is quicker?

2008-06-06 Thread Dennis Cote
oints (rectangles with zero area and zero length) to be handled by the RTree module. It would be incorrect to say that xmin must be less than xmax when they can be equal. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite

Re: [sqlite] Select problem with equal compare

2008-06-09 Thread Dennis Cote
where datetime(save_date) < '2008-05-25 17:03:33'; HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] rtree extension question

2008-06-09 Thread Dennis Cote
gt; Is there any function that would allow for tests like "new rect is > inside older rect" ? > No, again SQLite doesn't know anything about the rectangles your application is using to build the queries, only your application knows that. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] rtree extension question

2008-06-09 Thread Dennis Cote
net. Fortunately, the wayback machine still has a copy at http://web.archive.org/web/20041230195828/http://www.sqlite.org/php2004/page-001.html HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread Dennis Cote
a subcategory "Electricityr" > > So they would look like: > > Manuals > + Audio > + Phone > Receipts > + Water > + Gas > + Electricity > You could try select distinct category, subcategory from documents order by category, subcategory;

Re: [sqlite] graph question

2008-06-09 Thread Dennis Cote
David Baird wrote: > > Okay, just built SQLite 3.5.9 and group_concat does in fact work: > > select group_concat(t, ' ') from w where f=1; You forgot the parent value at the beginning. Also, the OP may want to do this for several parents which can be accomplished by grouping the results.

Re: [sqlite] prepare peformances

2008-06-09 Thread Dennis Cote
Bruce Robertson wrote: > Thanks, but I'm gonna need some further instruction or examples or pointers > to a resource as none of these statements mean anything to me. > Try reading this http://www.sqlite.org/cintro.html and see if it makes more sense after that. H

Re: [sqlite] prepare peformances

2008-06-09 Thread Dennis Cote
ml which still uses the sqlite3_exec() API and callback functions. My new version uses the prepare/step APIs and can be found at http://article.gmane.org/gmane.comp.db.sqlite.general/33742/match=quickstart HTH Dennis Cote ___ sqlite-users mailing lis

Re: [sqlite] prepare peformances

2008-06-10 Thread Dennis Cote
I am forwarding this to the list in the hope that someone else will have a good idea since the OP, toms, is having trouble posting himself. Dennis Cote toms wrote: > ok here is the code I use for the statements: > > here is the SQL: > > "UPDATE Statistics_

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Dennis Cote
an then scan through the surrogate results at its leisure. When the client is done you can close the memory database. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] transaction locks w/ multiple DBs open/ATTACHed (reposted)

2008-06-10 Thread Dennis Cote
ocking sequence does SQLite execute? > > If a transaction reads from multiple DBs but WRITES to only one DB, what > locking sequence does SQLite execute? > The answers to your questions are probably in here http://www.sqlite.org/atomiccommit.html HTH Dennis Cote

Re: [sqlite] transaction locks w/ multiple DBs open/ATTACHed (reposted)

2008-06-10 Thread Dennis Cote
ocking sequence does SQLite execute? > > If a transaction reads from multiple DBs but WRITES to only one DB, what > locking sequence does SQLite execute? > Other useful information may be found here http://www.sqlite.org/lockingv3.html HTH Dennis Cote ___

Re: [sqlite] Writing double into a socket file

2008-06-11 Thread Dennis Cote
uery with the largest result set. It is not a hack of any sort. It simply uses the public APIs to quickly copy the result data into a private table to avoid locking the entire database while those results are slowly scanned by a client. Dennis Cote

Re: [sqlite] Accessibility dependend on command and folder

2008-06-11 Thread Dennis Cote
nclusion that this error always refers to the main database file, and the existing error doesn't give any indication that there could be other causes. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Accessibility dependend on command and folder

2008-06-11 Thread Dennis Cote
_CANTOPENTEMP: z = "unable to create a temporary file"; break; And finally add suitable test cases. This step is left as an exercise for the reader. ;-) Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8

Re: [sqlite] datetime bug

2008-06-12 Thread Dennis Cote
me(2454629.0833); 2008-06-11 14:00:00 The base value for the hour is 14, and you are in a timezone with a +10 hour offset. It must be coming up with a sum that is slightly less than 24 hours so that it doesn't increment the day. The value is rounded correctly when formatt

Re: [sqlite] Structural detection of AUTOINCREMENT

2008-06-16 Thread Dennis Cote
(1); sqlite> select * from sqlite_sequence; nameseq -- -- t 1 sqlite> pragma table_info(t); cid nametypenotnull dflt_value pk -- -- -- -- -- --

Re: [sqlite] Implementing fast database rotation

2008-06-16 Thread Dennis Cote
maximum size. See http://www.nabble.com/limiting-table-size--to2035232.html#a2063150 for one way to do this. You would have to modify the insert trigger to make the backup copy of the old row before it is deleted. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Structural detection of AUTOINCREMENT

2008-06-17 Thread Dennis Cote
> I ask this because sqlite_master itself is not listed in sqlite_master > Yes, the sqlite_sequence table is listed in the sqlite_master table. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] help with Dates please

2008-06-17 Thread Dennis Cote
w.sqlite.org/lang_createtable.html. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite 3.5.9 build problem - token expected in btree.c

2008-06-17 Thread Dennis Cote
> I'm still using the older 3.4.5 version of GCC in MinGW, and I used the following set of commands to build SQLite from the sqlite source directory available from CVS (or download at http://www.sqlite.org/sqlite-3.5.9.tar.gz). mkdir build cd build ../sqlite/configure make HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to import CSV data if strings NULL?

2008-06-17 Thread Dennis Cote
und it easier to skip the first comma instead of trying to remove the last one. fisrt = True for col in row: if not first: sql = sql + "," if first: first = False if col=="": sql = sql + "NULL" else: sql = sql + "'" + col + "'" HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Long delay for delete/select row in database

2008-06-17 Thread Dennis Cote
comparisons. CREATE INDEX event_time on events(time); Now your queries can be simplified to: DELETE FROM events WHERE time < julianday('2008-06-16 10:21:55.806'); and SELECT * FROM events WHERE time between julianday('2008-06-16 00:00:00.000')

Re: [sqlite] Importing table

2008-06-17 Thread Dennis Cote
nteger or real values if the columns have suitable affinity (see http://www.sqlite.org/datatype3.html for more details). HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question about PRAGMA journal_mode

2008-06-18 Thread Dennis Cote
the internal data in the database corrupt. You have no control over this without atomic transactions. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Getting a table size without counting

2008-06-18 Thread Dennis Cote
t; >> query on it? > > This question comes up a lot. It sure does. It should probably be added to the FAQ. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Long delay for delete/select row in database

2008-06-18 Thread Dennis Cote
ween julianday('2008-06-16 23:59:59.999') and julianday('2008-06-17 00:00:00.000') HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Long delay for delete/select row in database

2008-06-18 Thread Dennis Cote
sibly quite small) window of time, rather than at a point in time. The difference is that identifying a point in time requires infinite precision, whereas identifying a period requires finite user defined precision. The window you need may be small but even a millisecond has a beginning and an

Re: [sqlite] Long delay for delete/select row in database

2008-06-18 Thread Dennis Cote
oint equality. > > Can I do it from tcl? And how use index? I'm not sure how you handle floating point values in TCL since it is typeless. It may not be possible to avoid the conversions. This is even more reason to use ranges to locate records by time, and rowids to locate specific r

Re: [sqlite] Getting a table size without counting

2008-06-18 Thread Dennis Cote
without actually executing the query? This sounds lie magic to me. How could it possibly know which regular expression you are going to use in a given count query? Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Long delay for delete/select row in database

2008-06-18 Thread Dennis Cote
umbers for these records, or why you are concerned that there might be multiple records with the same save_date for that matter? Is this table linked to any others? Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Getting a table size without counting

2008-06-18 Thread Dennis Cote
; It's better than use count(*) with "where" condition. I can't see how this improves the situation any. You are making SQLite do a full scan of the index (assuming all records have an id > 0) instead of a full scan of the table. It still has to count each record. Dennis

Re: [sqlite] Long delay for delete/select row in database

2008-06-19 Thread Dennis Cote
Alexey Pechnikov wrote: > > P.S. Is any method for multy-master replication of SQLite databases? Nothing built in, but I believe several user have developed their own systems to do this. You would probably be better off asking this question in a new thread. Denni

Re: [sqlite] Long delay for delete/select row in database

2008-06-19 Thread Dennis Cote
gt; Then I delete row on events table with the same bloc_id found on bloc_events > table. > > How to create a FOREIGN KEY with SQLite3? > SQLite allows you to use foreign keys for joins, but it does not enforce any referential integrity when rows are deleted. There are triggers you ca

Re: [sqlite] Getting a table size without counting

2008-06-19 Thread Dennis Cote
pages that might be used for the next data query, and hence slowing that data query down because it now has to reload the data pages. Adding such an index also slows down all insert, update, and delete operations because they must modify the index as well as the

Re: [sqlite] Regex parsing create statements

2008-06-19 Thread Dennis Cote
equire a substantial investment of time, but it usually results in more robust and flexible handling of language processing tasks. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Updating a BLOB field

2008-06-19 Thread Dennis Cote
place the data using an replace statement (an abbreviation of insert or replace) assuming that docnumber is the primary key. replace into archive (docnumber, document) VALUES (?,?) Otherwise you would use an update statement to do an update. update archive set document = ? where

Re: [sqlite] Performance on HP

2008-06-20 Thread Dennis Cote
CD' AND PHONETIC_KEY < 'ABCE' > The optimizer in SQLite will use an index for a like clause like your example. See section 4 of http://www.sqlite.org/optoverview.html for details. HTH Dennis Cote ___ sqlite-users mailing list sql

Re: [sqlite] configure syntax error on HP

2008-06-23 Thread Dennis Cote
tions and code C:/DOCUME~1/DENNIS~1.HAR/LOCALS~1/Temp/ccOS.o:test.c:(.text+0xd): undefined reference to `popuateOne' HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Brain error

2008-06-23 Thread Dennis Cote
s, you need to duplicate the point data to generate a range of zero length. insert into lookup(idField, xmin, xmax, ymin, ymax) select id, x, x, y, y from othertable; HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Regex parsing create statements

2008-06-23 Thread Dennis Cote
as > sqlite3, perl, AppleScript, PHP, not C. > You might be interested in the Pyparsing module at http://pyparsing.wikispaces.com/ for use with Python. It has lots of examples to help get you started. HTH Dennis Cote ___ sqlite-users mailing list s

Re: [sqlite] Availablility of current row information in a select

2008-06-23 Thread Dennis Cote
embedded SQL queries to pull data from other columns using the rowid to locate the record quickly (since it is already in the page cache). If the function foo() can be used with multiple tables, you would also need to pass the table name along with the rowid. HTH Dennis Cote _

Re: [sqlite] Accessing to database informations

2008-06-24 Thread Dennis Cote
tailed information about the columns in a table using the pragma table_info. Details are at http://www.sqlite.org/pragma.html pragma table_info('some_table'); both of these queries can be executed using the C API just like any other query. HTH Dennis Cote __

Re: [sqlite] bug with NULL in NOT IN

2008-06-25 Thread Dennis Cote
e changed to match the other database engines for improved standard compliance. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] bug help

2008-06-25 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > Is this the correct list for airing SQLite amalgamation compilation problems? > Yes. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] bug with NULL in NOT IN

2008-06-26 Thread Dennis Cote
esult row should be NULL, not "0"? > Since rule (d) above is not true for "1 IN (null, 2, 3)", do we fall > through to rule (e) and return NULL? > > Yes, that looks to be the case. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Update static database with records from memory database.

2008-07-02 Thread Dennis Cote
emp or vice versa. Note, "main" is the implicit name of the database that was opened as stats_static (i.e. by a call to sqlite3_open() by your eventscripts). stats_static.execute "INSERT into stats_temp.stats select * from main.stats" Once the temp data is loaded it can be

<    1   2   3   4   5   6   7   8   9   10   >