Re: [sqlite] copy table to another db file

2012-05-17 Thread Jay A. Kreibich
PKs or any other constraints. Newer versions of SQLite will attempt to preserve the column affinities, but, IIRC, older version will not (and all columns will have a NONE affinity). CREATE TABLE...AS SELECT is great for temp tables, but it is not a useful way to truly "copy" a

Re: [sqlite] sqlite Commit C API

2012-05-17 Thread Jay A. Kreibich
g:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > > > > > > -- > > D. Richard Hipp > > d...@sqlite.org > > _______ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:80

Re: [sqlite] sqlite Commit C API

2012-05-20 Thread Jay A. Kreibich
#x27;re going to see seeks and random rotation delays that should be even larger than this. -j > sort fsync.dat | tail -n 5 > fsync time: 0.0025 > fsync time: 0.0025 > fsync time: 0.0026 > fsync time: 0.0027 > fsync time: 0.0059 > -- Jay A. Kreibich < J A Y @ K R E

Re: [sqlite] sqlite Commit C API

2012-05-20 Thread Jay A. Kreibich
e, but it isn't doing anything. If you're actually writing data to a spinning disk, I would expect times to be varied, and average out to slightly more than half a rotation. And rotations still take a LONG time in modern computing terms. -j -- Jay A. Kreibich < J A Y @ K R

Re: [sqlite] group_concat() on a JOIN problem

2012-06-04 Thread Jay A. Kreibich
ways distinct. > Is there a way I could achieve this? You want the DISTINCT on the aggregate, not the result set: SELECT group_concat( DISTINCT TB.F2, ' ' ) AS -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is im

Re: [sqlite] Features of SQLite question

2012-06-11 Thread Jay A. Kreibich
omplex than it first sounds. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson

Re: [sqlite] Features of SQLite question

2012-06-11 Thread Jay A. Kreibich
likely source-control systems. And they're typically very complex, traditionally have a central "master" dept, and often require human intervention to untangle the mess when a merge goes wrong. They're actually an easy case. -j --

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Jay A. Kreibich
On Fri, Jun 15, 2012 at 12:12:22PM +, Black, Michael (IS) scratched on the wall: > Could the SQLite code add a new dummy function for a callback which > we can then override with our own library? Just use an SQL function: http://sqlite.org/c3ref/create_function.html -j --

Re: [sqlite] order by clause should come after union not before

2012-06-15 Thread Jay A. Kreibich
where aph>0 or hctl=1" That will also avoid duplicate rows if a specific row meets both conditions. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it,

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Jay A. Kreibich
by the shell and many programs. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson __

Re: [sqlite] (shell dependent) library rounding error

2012-06-15 Thread Jay A. Kreibich
ntf conversion. By default, it is limited to 6 decimal places. If it only sees zeros, it will roll the number back up. The number isn't "wrong", it is just being displayed in a shortened notation. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence

Re: [sqlite] VERY weird rounding error

2012-06-16 Thread Jay A. Kreibich
ow > where it is getting this value from however. If by "this value" you mean the 6, that's the default precision for "%f" conversion in the printf() family of functions. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like under

Re: [sqlite] escaping GLOB pattern

2012-06-18 Thread Jay A. Kreibich
do not have to escape a * inside a parameter, you cannot use a parameter to reference the name of a table or column. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has

Re: [sqlite] bug "PRAGMA table_info"

2012-06-19 Thread Jay A. Kreibich
does not take databases as table names. "test" works > as an argument, but "main.test" doesn't. No, but following the standard of every other PRAGMA, this does work: PRAGMA main.table_info( test ); See the syntax diagrams here: http://sqlite.org/pra

Re: [sqlite] sqlite compound keys

2012-06-21 Thread Jay A. Kreibich
from the index itself, and will never touch the main table record. This is more efficient, even if the index is known to have poor diversity. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it t

Re: [sqlite] Problem with concurrent transaction and DETACH DATABASE

2012-06-21 Thread Jay A. Kreibich
() or _finalize() because of locking semantics. If your program can call one of those APIs and maintain correct flow, it should be calling them. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showin

Re: [sqlite] Detecting when a table is created

2012-06-26 Thread Jay A. Kreibich
-interaction. Even then, it might not work... I have no idea if things are "inserted" into sqlite_master in the standard way. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to

Re: [sqlite] Virtual tables: rename, disconnect and reconnect

2012-06-26 Thread Jay A. Kreibich
how to use them. It happens to be the longest chapter in the book, and walks through two full examples. One of the examples is using a virtual table to map web-server logs to an SQLite table without importing the data. From what you said, that sounds somewhat similar to your problem.

Re: [sqlite] Virtual Tables: idxStr parameter for xBestIndex and xFilter

2012-06-26 Thread Jay A. Kreibich
cing them to cast back and forth for the exception to the rule seems like a bit of waste. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them fee

Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Jay A. Kreibich
t; > How can this be fixed ? Move two timezones to the west. (By default all times and dates are UTC.) -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tenden

Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Jay A. Kreibich
On Wed, Jun 27, 2012 at 05:45:41PM +0200, deltagam...@gmx.net scratched on the wall: > Am 27.06.2012 17:40, schrieb Jay A. Kreibich: > >On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on > >the wall: > > > >>Hello, > >> >

Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jay A. Kreibich
v2() deals with this condition automatically is generally considered to be a feature. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the t

Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-07-02 Thread Jay A. Kreibich
pe. As long as you use the encoder function for inputs and the decoder for all outputs, you should be good. That starts to get deep into your SQL, however. The ability to define native types is similar in complexity to adding user-defined functions. Just a thought. Any opinions? -j

Re: [sqlite] max size of a TEXT field

2012-07-02 Thread Jay A. Kreibich
d, but there is a hard limit of (2^31 - 1), or 2GB. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomforta

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
L rows, you need to update only the non-NULL rows: UPDATE table SET column=NULL WHERE column IS NOT NULL; As for sqlite3_changes() returning 0, that doesn't sound right unless you're checking inside the trigger. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
doesn't change what it does. There is, however, little argument that the trigger is doing exactly what one would expect. You are applying an update operation to every row, and the trigger is firing for every row. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Inte

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Jay A. Kreibich
t;>?3. > (passing a null parameter to the above won't even work!) Well, no, it won't, because you're using the wrong operator. Use "WHERE col1 IS NOT ?1 AND..." and it all works fine. > No surprises there. Oracle has never managed to impress me.

Re: [sqlite] Bug in sqlite3_step

2012-07-03 Thread Jay A. Kreibich
de-effect of the fact that CREATE statements are copied into the sqlite_master table as literals, and not re-written? (Is that even true?) -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Jay A. Kreibich
name ); sqlite3_prepare_v2( db, sql_str, -1, &stmt, NULL ); sqlite3_free( sql_str ); -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to ma

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Jay A. Kreibich
orts several extensions to the standard printf() syntax in the sqlite3_*printf() family of functions. Both %q and %Q can be used for values, while %w can be used for identifiers. The sqlite3_*printf() functions will properly quote and sanitize any value in the generated string. There is also

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Jay A. Kreibich
On Wed, Jul 04, 2012 at 08:29:33AM -0500, Jay A. Kreibich scratched on the wall: > On Wed, Jul 04, 2012 at 01:09:01AM -0500, Nico Williams scratched on the wall: > > > But this would > > just be a glorified (if safer) variant of sqlite3_mprintf() -- for > > apps that allow

Re: [sqlite] Standalone LUA regex that can be used in sqlite

2012-07-05 Thread Jay A. Kreibich
uality: http://www.sqlite.org/contrib/ Also see: sqlite3_auto_extension() http://www.sqlite.org/c3ref/auto_extension.html sqlite3_load_extension() http://www.sqlite.org/c3ref/load_extension.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is

Re: [sqlite] When to call VACUUM - revisited

2012-07-05 Thread Jay A. Kreibich
nce boost from a VACUUM. I'd be more concerned about filesystem fragmentation than I would be about SQLite fragmentation. > You could use the shell tool to turn the database file into SQL commands, > and then back into a new database file on disk. This will both > defragment t

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Jay A. Kreibich
the latest version of SQLite, otherwise it won't work. Also, not to state the obvious, but you can only share a :memory: database across connections that originate from the same process. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is i

Re: [sqlite] Virtual Tables: xSync without xBegin

2012-07-12 Thread Jay A. Kreibich
ost welcome > > > >Regards > >Olivier > >___ > >sqlite-users mailing list > >sqlite-users@sqlite.org > >http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > >

Re: [sqlite] (no subject)

2012-07-18 Thread Jay A. Kreibich
ering the occasional spam message. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson ___

Re: [sqlite] select speed

2012-07-19 Thread Jay A. Kreibich
ect > > Single table with 20 columns. Unless your data is very unusual. However, insert/updates/deletes are likely to be faster on the smaller tables. Worry about design first, then optimize for speed. "Normalize 'till it hurts, denormalize until it works." -j

Re: [sqlite] C++ - Finalizing my SQLite interface

2012-07-27 Thread Jay A. Kreibich
really something of an error condition. It means your application lost track of something, and failed to free a dependent resource. Having your object blindly finalize statements is very likely to leave a dangling pointer elsewhere in the application. -j -- Jay A. Kreibich < J A Y

Re: [sqlite] SQLITE_STATIC and temporary data

2012-08-01 Thread Jay A. Kreibich
lled, but, yes... this use of SQLITE_STATIC is acceptable (and somewhat common). -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel unc

Re: [sqlite] SQLITE_STATIC and temporary data

2012-08-01 Thread Jay A. Kreibich
would have to be _finalize() or _clear_bindings(). But yes... the key is that the memory remains valid for the lifetime of the binding, not the fact that is or isn't statically allocated. -j > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite

Re: [sqlite] Any plans to provide the sqlite3RunParser in the API

2012-08-13 Thread Jay A. Kreibich
ing SQLite": http://shop.oreilly.com/product/9780596521196.do -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendenc

Re: [sqlite] app-defined functions, statements and sqlite3_value

2012-08-21 Thread Jay A. Kreibich
yped languages, it might be better to expose the sqlite3_value object as an opaque object and provide the standard bind, column, result, and value APIs. You don't have a lot of choice in that case. Just be aware there is no way to create an sqlite3_value object from scratch. You

Re: [sqlite] some questions about sqlite

2012-09-01 Thread Jay A. Kreibich
an issue, and you don't want hundreds of connections banging on the same file, but that's true no matter if the connections come from the same process or not. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you

Re: [sqlite] some questions about sqlite

2012-09-02 Thread Jay A. Kreibich
On Sat, Sep 01, 2012 at 11:56:33PM -0700, J Decker scratched on the wall: > On Sat, Sep 1, 2012 at 8:24 PM, Jay A. Kreibich wrote: > > On Sat, Sep 01, 2012 at 07:37:04PM -0700, J Decker scratched on the wall: > >> On Sat, Sep 1, 2012 at 7:32 PM, Simon Slavin wrote: > >

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Jay A. Kreibich
(though non-zero) chance that a power failure at just the wrong time could corrupt the database in NORMAL mode. But in practice, you are more likely to suffer a catastrophic disk failure or some other unrecoverable hardware fault. -j -- Jay A. Kreibich < J A Y @

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Jay A. Kreibich
s describe this fairly well, but from the sound of it you need FULL for durability. On the other hand, WAL requires fewer write to commit a transaction, so (if I'm reading this correctly) FULL in WAL mode is much faster than FULL in non-WAL mode. -j -- Jay A. Kreibich < J A Y @

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Jay A. Kreibich
On Mon, Sep 10, 2012 at 09:50:58PM -0500, Jay A. Kreibich scratched on the wall: > On Tue, Sep 11, 2012 at 01:58:23AM +0100, Simon Slavin scratched on the wall: > > On 11 Sep 2012, at 12:55am, Keith Chew wrote: > > > > and I know FULL (1) will provide that. The question i

Re: [sqlite] Count(*) help

2012-09-17 Thread Jay A. Kreibich
le, in SQL "NULL OR 1" is 1 (true) and "NULL AND 0" is 0 (false). Arguments about the semantic details of Relational algebra aside, if you treat NULL as "unknown", most of the database operators and functions make sense. http://en.wikipedia.org/wiki/Three-value

Re: [sqlite] Virtual tables are driving me insane!

2012-09-21 Thread Jay A. Kreibich
takes a bit to wrap your head around, but don't worry about it too much. Unless you're writing a VT that provides a specialized index, you can usually just ignore it and get the basic VT working with table scans before you worry about making the VT index aware. A lot of the VT mod

Re: [sqlite] Unofficial poll

2012-09-24 Thread Jay A. Kreibich
o this kind of thing in a traditional database. Did it make my life easier, the code simpler, and the database smaller and more compact? Heck, yes. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but

Re: [sqlite] Unofficial poll

2012-09-24 Thread Jay A. Kreibich
y wants strong typing, that's easy enough to do. Just add a check constraint to your column defs: CREATE TABLE t ( i integer CHECK ( typeof( i ) == 'integer' ), t text CHECK ( typeof( t ) == 'text' ), r float CHECK ( typeof( r ) ==

Re: [sqlite] Unofficial poll

2012-09-24 Thread Jay A. Kreibich
On Mon, Sep 24, 2012 at 09:05:51PM +0400, Yuriy Kaminskiy scratched on the wall: > Jay A. Kreibich wrote: > > And finally, for anyone that really wants strong typing, that's easy > > enough to do. Just add a check constraint to your column defs: > > > &

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-26 Thread Jay A. Kreibich
clean /tmp on reboot, and that can be months, if not years, on many Unix systems. Some don't clean /tmp at all. The "create and unlink" pattern is so common, many UNIX systems have a tmpfile() or similar library call to do the whole thing... create a unique file in /tm

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-27 Thread Jay A. Kreibich
this will not solve every problem. Even with a timeout, there are situations when you can still get a locking error and your only choice is to rollback and try again. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you ha

Re: [sqlite] Sending SQLite3 .timeout command in Command-Line Mode

2012-09-28 Thread Jay A. Kreibich
nd handle the vast, vast majority of SQLITE_BUSY errors, however. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-28 Thread Jay A. Kreibich
pplication terminates for any reason. It will create the file in the system's default temp space, which is /tmp in the case of UNIX systems. This call is part of the POSIX platform standard, as well as the ISO C-90 standard. I'm sure one could trace its roots back pretty far into th

Re: [sqlite] Feature request: Add pragma CONCAT_NULL_YIELDS_NULL

2012-10-08 Thread Jay A. Kreibich
on that includes a concat() function. That way you get the function you want and the behavior you want. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tende

Re: [sqlite] VTab & xRename

2012-10-23 Thread Jay A. Kreibich
the table, the whole application will simply crash. Your fault. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- An

Re: [sqlite] how to select "

2012-10-24 Thread Jay A. Kreibich
#x27;t work. SQL string literals use single quotes. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson

Re: [sqlite] in memory to void *data (and back)

2012-11-13 Thread Jay A. Kreibich
les ? Not simpler, but cleaner... write a VFS plugin that reads/writes to a memory block. Use the backup API to go straight in and out of that, rather then a file. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that

Re: [sqlite] creating indexes on empty columns

2012-11-25 Thread Jay A. Kreibich
te, all columns are in all indexes even if the column contains a > NULL. NULL has a sorting order, and anything that does Rows, Simon, rows... not columns. Watch your terminology or your answers will be more confusing than the questions. -j -- Jay A. Kreibich < J A Y @ K R E I

Re: [sqlite] creating indexes on empty columns

2012-11-25 Thread Jay A. Kreibich
rows, it will slow down, rather than speed up, a query. Indexes are not magic bullets, and using them properly requires understanding how they work and how they are used. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important th

Re: [sqlite] creating indexes on empty columns

2012-11-25 Thread Jay A. Kreibich
On Sun, Nov 25, 2012 at 12:41:21PM -0700, Keith Medcalf scratched on the wall: > > On Sunday, 25 November, 2012, 11:58, Jay A. Kreibich wrote: > > > each column is usually undesirable. A given SELECT can usually only > > use one index per query (or sub-query), so it

Re: [sqlite] Converting in-memory sqlite database to char array

2012-11-29 Thread Jay A. Kreibich
I would not assume the backup API writes the file front to back, especially if the database is modified while the backup is taking place. A custom VFS that just "writes" the file to a big chunk of memory makes the most sense. -j -- Jay A. Kreibich < J A Y @ K R E I

Re: [sqlite] Converting in-memory sqlite database to char array

2012-11-29 Thread Jay A. Kreibich
backup gets caught in a restart loop, some people choose to make the backup a more atomic operation by having the backup "step" function copy all the pages in one go. In that case it is likely that the majority of pages are written out in-order, but I wouldn't want to bank on

Re: [sqlite] Foreign keys needing an index

2012-11-30 Thread Jay A. Kreibich
to setup an FK that references a column or set of columns that does not have a UNIQUE constraint, either the FK is broken or the parent table is broken. ...which is not to say a general purpose tool still needs to deal with this, as there are plenty of broken database designs out there.

Re: [sqlite] Memory using: is it normal

2012-12-01 Thread Jay A. Kreibich
most systems the default page size is 1K, but it can be 4K on some Windows systems. That makes the 16MB look a shade big, but it might be about right if you're running on a Windows system, or if you've adjusted the default page size and/or cache size. -j -- Jay A.

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Jay A. Kreibich
thod is to edit sqlite_master directly. > I know it is all saved as text No, it isn't. That was true of SQLite 2, but SQLite 3 stores types in their native format. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important th

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Jay A. Kreibich
On Sun, Dec 02, 2012 at 12:52:33PM -0800, Igor Korot scratched on the wall: > Jay, > > On Sun, Dec 2, 2012 at 12:16 PM, Jay A. Kreibich wrote: > > On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall: > >> Hi, ALL, > >> ALTER TABLE comm

Re: [sqlite] Database size bigger than before deleting records

2012-12-02 Thread Jay A. Kreibich
e when rows have been deleted from the database, however. Not to ask the obvious, but are you sure the rows were actually deleted? Was auto-vacuuming on? -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, bu

Re: [sqlite] Bug in sqlite3_bind_parameter_name

2011-06-02 Thread Jay A. Kreibich
ed-- or the whole statement should be considered invalid and an error thrown. While the phantom parameter issue might be worth addressing, in this specific case I think it is fair to call the query incorrect. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-05 Thread Jay A. Kreibich
uot;very large but not exactly known" number, minus one of the same, might result in anything from +Inf to -Inf. Hence, the "unknown" NULL. I'd guess most IEEE 754 results of NaN will produce a NULL in SQL, since both can mean "unknown" or "missing/illog

Re: [sqlite] Howto pivot in SQLite

2011-06-05 Thread Jay A. Kreibich
es together into a single, less clear value, just for the sake of making one query, rather than two? Or even one query, but with an extra line or two of code in the parse function? Why not just deal with values in their native, and more correct, "list of images" format? -j

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-06 Thread Jay A. Kreibich
in a data storage system. Write a C or assembly program and have all the close, fine-grain detail you want. As you've pointed out, SQLite is more than capable of storing and retrieving non-numeric IEEE 754 values, so it is doing its core job just fine. -j -- Jay A. Kreibich &

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-06 Thread Jay A. Kreibich
doesn't deal with floating point numbers for your definition of "as it should." -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them f

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-06 Thread Jay A. Kreibich
t; retrieving non-numeric IEEE 754 values > > No, it doesn't support storing and retrieving NaNs. You're right... Even using the C API, if you try to call sqlite3_bind_double( stmt, p, 0.0 / 0.0 ), the NaN is converted into a NULL before it is written to the database. Inf works

Re: [sqlite] Example Showing ACTUAL Use of sqlite3_auto_extension()

2011-06-07 Thread Jay A. Kreibich
-- Finally, you can call this in your application: sqlite3_auto_extension( (void(*)(void))extension_functions_init ); With that done, any database you open with that application should have the extens

Re: [sqlite] Handling of IEEE-754 nan and +/-inf in SQLite?

2011-06-07 Thread Jay A. Kreibich
t; range. ** In my own experiences working at NCSA, two national labs, and several university HPC projects, most people doing "scientific computing" don't have a damn clue. Most of the "scientific computing" code I saw was written by domain grad students or

Re: [sqlite] Dynamically loaded sqlite (linux)

2011-06-07 Thread Jay A. Kreibich
ary requires no code changes. The dlopen() and related functions are for application controlled linking. They're like the LoadLibrary() functions under Windows. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you

Re: [sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Jay A. Kreibich
tes in the header file. src/test_intarray.h http://www.sqlite.org/cgi/src/artifact/489edb9068bb926583445cb02589344961054207 src/test_intarray.c http://www.sqlite.org/cgi/src/artifact/d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99 -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "I

Re: [sqlite] Implicitly creating a table containing the first N consecutive integers?

2011-06-07 Thread Jay A. Kreibich
al table that does something > pretty much like the above. We've recently started using it some for > our test cases. Ooo... that's even more nifty and simple. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you

Re: [sqlite] ATTACH DATABASE .tables .schema ?

2011-06-13 Thread Jay A. Kreibich
> > .tables T > > Produce no results. You can't. The CLI dot-commands only show results for the "main" and "temp" databases. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important th

Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Jay A. Kreibich
f/busy_handler.html <= deadlock info http://sqlite.org/c3ref/busy_timeout.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable.&q

Re: [sqlite] Implementing busy-waiting on SQLite

2011-06-13 Thread Jay A. Kreibich
d release all the locks. Of course, many, many applications out there don't deal with this correctly, so you would need to be careful with a general-access database. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that

Re: [sqlite] SQLITE_CANTOPEN on an open database

2011-06-20 Thread Jay A. Kreibich
ht try changing the journal mode to "truncate." http://www.sqlite.org/pragma.html#pragma_journal_mode -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people

Re: [sqlite] openmpi parallel problem

2011-06-23 Thread Jay A. Kreibich
cgi-bin/mailman/listinfo/sqlite-users > >>> > >> ___ > >> sqlite-users mailing list > >> sqlite-users@sqlite.org > >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > >> > >

Re: [sqlite] ISNULL in sqlite

2011-06-25 Thread Jay A. Kreibich
here MyField isnull is also supported. http://www.sqlite.org/lang_expr.html ("is null" is just a standard "is" with the right side expression being a literal NULL.) -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear:

Re: [sqlite] Minimal SQLite

2011-07-04 Thread Jay A. Kreibich
ngs. If you're using an extensive number of OMIT flags, a bit of code clean-up may be required. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people ha

Re: [sqlite] multidimensional representation

2011-07-06 Thread Jay A. Kreibich
he query syntax can get quite messy. I would put together a few example cases of what you're trying to do with your application. In addition to the data layout, pay specific attention to the types of queries you need to run and how you're going to set those up. -j -- Jay A.

Re: [sqlite] Transaction and SQLITE_CANTOPEN

2011-07-14 Thread Jay A. Kreibich
le associated with the transaction. Make sure your application has write/create permissions to the directory with the database file. If you cannot provide that, put the database in a subdirectory and provide the permissions on the subdirectory. -j -- Jay A. Kreibich < J A Y @ K R

Re: [sqlite] Performance Improvement

2011-07-18 Thread Jay A. Kreibich
or both storage space and your specific access patterns. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela

Re: [sqlite] "override" table?

2011-07-20 Thread Jay A. Kreibich
S ( 2, 2, 22, 222 ); sqlite> sqlite> SELECT coalesce( over.a, real.a ) AS a, ...>coalesce( over.b, real.b ) AS b, ...>coalesce( over.c, real.c ) AS c ...> FROM real LEFT OUTER JOIN over USING ( id ); 1|10|100 2|22|222 3|30|300 sqlite> The order of the j

Re: [sqlite] "override" table?

2011-07-20 Thread Jay A. Kreibich
e. Using the OUTER JOIN allows you to use arbitrary WHERE clauses, including queries that return multiple rows. That said, most people would likely consider the UNION approach easier to understand. -j > > Keith > > On Jul 20, 2011 11:35am, "Jay A. Kreibich" wrote

Re: [sqlite] Strange result using JOIN

2011-07-22 Thread Jay A. Kreibich
; > 61311;18461F; In SQL terms, these are the exact same. Table rows are *unordered* and can be returned in any order the database wants. If you need a result in a specific order, you must use an ORDER BY clause in your SELECT statement. -j -- Jay A. Kreibich < J A Y

Re: [sqlite] Strange result using JOIN

2011-07-22 Thread Jay A. Kreibich
It is the application code that needs to get fixed to accept data in an order that the SQL standard can provide. This isn't true of only SQLite, but all SQL database systems. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is impor

Re: [sqlite] DEvelopment Error

2011-07-25 Thread Jay A. Kreibich
ry. in my > programs main healer i did : #include "sqlite3ext.h" and linked the > LIB file. You want to use "sqlite3.h" in applications. The "sqlite3ext.h" file is for building library extensions -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H >

Re: [sqlite] SELECT query first run is VERY slow

2011-07-27 Thread Jay A. Kreibich
create index idx2 on t(i,rowid); > Error: table t has no column named rowid > > Any particular reason it can't be included in an index? Because it is always included as the last column. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like u

Re: [sqlite] Editing sqlite3 commands

2011-07-28 Thread Jay A. Kreibich
On Thu, Jul 28, 2011 at 12:57:45PM -0700, km4hr scratched on the wall: > > Is there a way to edit SQL commands typed in on the command line? Only if the "sqlite3" tool is compiled with a copy of the readline library. In that case, just hit up-arrow. -j -- Jay A.

Re: [sqlite] Exclusive locking mode not working as expected?

2011-07-29 Thread Jay A. Kreibich
t; to the database files. "PRAGMA locking_mode = EXCLUSIVE" never releases the locks. http://www.sqlite.org/pragma.html#pragma_locking_mode -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but

Re: [sqlite] Exclusive locking mode not working as expected?

2011-07-29 Thread Jay A. Kreibich
e access? You can set the file permissions. That's a more appropriate means to prevent this kind of operation. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has

<    4   5   6   7   8   9   10   >