Re: [sqlite] "x NATURAL JOIN x" BUG

2009-10-19 Thread Jay A. Kreibich
On Mon, Oct 19, 2009 at 09:28:35PM +0200, Kristoffer Danielsson scratched on the wall: > > I'll investigate this bug later. I'm quite sure it's no more than a > couple of months old, Just tested in 3.4.0 (June 2007) and it does the exact same thing. -j -- Jay A

Re: [sqlite] SQLITE_ENABLE_COLUMN_METADATA question ...

2009-10-26 Thread Jay A. Kreibich
naltered, column directly from a specific table. Any kind of expression (including aggregate functions) means the data values in that result did not come directly from a specific table column, and therefore these functions return NULL. If you need a more general way to get the name of any column in

Re: [sqlite] Conditional JOIN

2009-10-26 Thread Jay A. Kreibich
a double-join, but that's one baisc approach. The heart of the issue is that there is no way to test if a row has a match or not within a single JOIN. You must do the LEFT JOIN to see if there was a match or not. Then, based off the information of that JOIN, you can do the JOIN again and

Re: [sqlite] Grammar of "X is Y"

2009-10-27 Thread Jay A. Kreibich
On Tue, Oct 27, 2009 at 04:15:57PM +, Tom Sillence scratched on the wall: > because I really want to write neat queries like: > > select col1 is col2 from table Are you sure? You just want a result set of true/false values? -j -- Jay A. Kreibich < J A Y @ K R E I B I

Re: [sqlite] Conditional JOIN

2009-10-27 Thread Jay A. Kreibich
eTable THEN ...> A1.PriceTable = B2.PriceTable AND B1.rowid = B2.rowid ...> ELSE ...> 'STANDARD' = B2.PriceTable ...> END ); I think that will do something closer to what you want. -j, now my brain hurts -- Jay A. Kreibich < J A Y @

Re: [sqlite] Grammar of "X is Y"

2009-10-27 Thread Jay A. Kreibich
On Tue, Oct 27, 2009 at 04:07:37PM -0700, Darren Duncan scratched on the wall: > Jay A. Kreibich wrote: > > On Tue, Oct 27, 2009 at 04:15:57PM +, Tom Sillence scratched on the > > wall: > >> because I really want to write neat queries like: > >> &g

Re: [sqlite] Late data typing. Am I missing something?

2009-10-28 Thread Jay A. Kreibich
but it should have been exposed in > the API. No, no... Something like this, in SQL: CREATE TABLE t ( i INTEGER CHECK (typeof(i) = 'integer') ); This allows "strong" type checking on just the columns you care about. Just be aware that it also prevents NULLs.

Re: [sqlite] Late data typing. Am I missing something?

2009-10-29 Thread Jay A. Kreibich
documentation is poor, which may be partly correct, but I think the real issue here is that dates, times, and timezones are hard. They sound very simple, and we all use them every day, so it feels like it just shouldn't be hard or complex. But it is. And making more and more datatypes

Re: [sqlite] Late data typing. Am I missing something?

2009-10-29 Thread Jay A. Kreibich
date and time functions (mixed in with SQL commands) http://sqlite.org/lang_datefunc.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Jay A. Kreibich
expressions need to go into the CREATE TABLE definition. They can't be added after-the-fact, like key triggers. There are ways around this, of course, but they're kind of messy. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starsh

Re: [sqlite] Table within a table??

2009-10-31 Thread Jay A. Kreibich
quite thankful that SQLite is so easy to integrate and makes so many ugly data management issues just disappear. I know that's where I am. Anyways... I've gone on long enough. Good luck with your design. Think a bit, ask good questions, and hopefully we can all see a differen

Re: [sqlite] Table within a table??

2009-11-01 Thread Jay A. Kreibich
esent a relation without adding or losing state or informational value is... (surprise!) another relation. On the details of this you're just going to have to trust me. Or, better yet: don't. Pick up a copy of "Database In Depth" yourself. You're likely to look at

Re: [sqlite] sqlite3 commandline interface questions

2009-11-01 Thread Jay A. Kreibich
mmand, which I do not recall seeing on the sqlite.org web > site documentation. I wonder what else I'm missing. $ sqlite3 SQLite version 3.6.18 Enter ".help" for instructions <=== You're missing this. sqlite> It isn't "full", but it will tell you

Re: [sqlite] Table within a table??

2009-11-03 Thread Jay A. Kreibich
el is that a system can *physically* store the data in all kinds of interesting ways because all the transforms are 100% reversible. You don't really need to store the table, as defined, in any physical way as long as you can compute it from the data you've stored. RVAs, as

Re: [sqlite] in-memory database concept

2009-11-04 Thread Jay A. Kreibich
r between > C++ and Java. It requires some efforts. Yes, that's how it is supposed to work. A ":memory:" database can only be accessed by the database handle that created it. They're not designed to be shared. http://www.sqlite.org/inmemorydb.html -j -- Jay A

Re: [sqlite] User-defined infix functions

2009-11-04 Thread Jay A. Kreibich
gt; optional parameter to the registering interface, or would it require > too much deep surgery in the parser guts? I suspect it would be far too deep to do at runtime. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with

Re: [sqlite] Locking bug?

2009-11-04 Thread Jay A. Kreibich
u need to handle this situation yourself. Is process A cleanly exiting when the lock is left behind? What OS and filesystem are you using? -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor.

Re: [sqlite] Avoiding "Ambigious column"?

2009-11-08 Thread Jay A. Kreibich
first (and only the first) column is getting merged, or the third query wouldn't have two "b" columns. I'm not sure what is going on here, but it doesn't look right. I'm just not exactly sure how it is wrong. Thinking it might be related to the t-NJ-t iss

Re: [sqlite] Database is locked

2009-11-10 Thread Jay A. Kreibich
rg/c3ref/busy_timeout.html This will keep trying if things still look safe, but will return SQLITE_BUSY right away if SQLite detects a possible deadlock. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a prot

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-10 Thread Jay A. Kreibich
ady compiled) for the Mac? > > From here: > >http://www.sqlite.org/download.html The only pre-compiled OS X binary up there is the analyzer. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a pr

Re: [sqlite] Need help constructing a query

2009-11-11 Thread Jay A. Kreibich
FROM IPtoCC JOIN Exclude ON IPtoCC.CC = Exclude.CC) AND > (SELECT IPTo FROM IPtoCC JOIN Exclude ON IPtoCC.CC = Exclude.CC) I think you need to add WHERE clauses to the sub-selects so you pick the proper upper and lower bound for that base value. Something like "...WHERE base.ip

Re: [sqlite] sqlite3 for Mac OSX 10.5

2009-11-11 Thread Jay A. Kreibich
ry/library. No use installing a new one if you keep using the old one -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go hom

Re: [sqlite] collation bug?

2009-11-12 Thread Jay A. Kreibich
"PtrToClassInstance" must be a pointer to the class instance you want called. If you're registering this inside your C++ class, you can use "this". -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atom

Re: [sqlite] Fine-grainy error report needed

2009-11-16 Thread Jay A. Kreibich
other answers are correct. A quick scan of the code makes me thing the only column capable of returning SQLITE_MISMATCH is a ROWID or INTEGER PRIMARY KEY alias, and there can only be one of those per table, and there can only be one table per INSERT. -j -- Jay A. Kreibich < J A Y

Re: [sqlite] listing free bytes in sqlite files

2009-11-18 Thread Jay A. Kreibich
size will return the number of bytes per page. You can expect a VACUUM to shrink a database file at least freelist_count * page_size bytes. Maybe a bit more if it can recover some of the intra-page free space. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is

Re: [sqlite] Suggested user-defined-function example

2009-11-19 Thread Jay A. Kreibich
s in the SQLite library, rather than in your application code or in an external library. You can do the same. You could also just write your own custom collation, but that's a whole different story. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is

Re: [sqlite] Force cache flush?

2009-11-19 Thread Jay A. Kreibich
ut these > don't appear to be written to the actual database file until the > application quits. If you're using the C API, make sure you call sqlite3_reset() and/or sqlite3_finalize() to close out the statement. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > &

Re: [sqlite] command line does not accept arrow keys

2009-11-20 Thread Jay A. Kreibich
-o sqlite3 sqlite3.c shell.c -lreadline -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string."

Re: [sqlite] Nested calls to prepare/step/prepare

2008-02-29 Thread Jay A. Kreibich
have open? For example, how many prepared statements I can have somewhere between their first sqlite3_step() call and sqlite3_reset(). Also, are there any limits on how those statements interact? Will the inner statement be run in its own transaction? Does the outer statement need to

Re: [sqlite] Generating new rowid algo

2008-03-10 Thread Jay A. Kreibich
of some records. Now what rowid > will be assigned to a new row that is added? Depends on how the table is setup. For more information: http://www.sqlite.org/autoinc.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses sh

Re: [sqlite] Does an sqlite3_get_table() results set get updated.

2008-03-10 Thread Jay A. Kreibich
al sqlite3_exec() call are not reflected in subsequent calls to sqlite3_errcode() or sqlite3_errmsg(). In other words, "No." You need to run it again. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas

Re: [sqlite] A few question using sqlite

2008-03-12 Thread Jay A. Kreibich
verything beyond that would random. Things work a bit differently if you're sorting an in-memory data structure with a stable sort, but that's not the case if you keep going back to the database for you records. Depending on how many of your columns allow duplicate entries (

Re: [sqlite] A few question using sqlite

2008-03-13 Thread Jay A. Kreibich
On Thu, Mar 13, 2008 at 12:41:15PM +0500, Zoltan Bencik scratched on the wall: > Hello, > > Thank you all for answering my questions. > > On Thu, Mar 13, 2008 at 8:23 AM, Jay A. Kreibich <[EMAIL PROTECTED]> wrote: > > On Wed, Mar 12, 2008 at 11:50:57PM +0500, Zol

Re: [sqlite] Efficiency Question - Value Or Liability for Indexing of This Table?

2008-03-14 Thread Jay A. Kreibich
ce a UNIQUE constraint on each individual column, you have to create a specific UNIQUE INDEX on each column. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja"

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-14 Thread Jay A. Kreibich
table (and, if possible, real data values), it is difficult to say what the problem is. CONSTRAINT issues are normally data issues, not code problems. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.&#x

Re: [sqlite] step back (again)

2008-03-14 Thread Jay A. Kreibich
the forward query use "AND title>=:firsttitle" and pitch rows that match any of the remembered RowIDs. (Backwards use "<=".) You'll also need to increase your LIMIT by the number of RowIDs you remembered. If you don't end up pitching rows and get a full

Re: [sqlite] Value between changes

2008-03-14 Thread Jay A. Kreibich
50, even through there is a higher max value in an A0 record that sits between the A2 records. I'm not sure what you mean by "overcounting" codes. Doesn't the GROUP BY essentually break up the select into sub-groups of rows with matching code values, and then (and on

Re: [sqlite] Efficiency Question - Value Or Liability for Indexingof This Table?

2008-03-15 Thread Jay A. Kreibich
On Sat, Mar 15, 2008 at 09:13:46AM -0400, Igor Tandetnik scratched on the wall: > "Jay A. Kreibich" <[EMAIL PROTECTED]> wrote > in message news:[EMAIL PROTECTED] > > indexes will slow > > writes (and more indexes will slow writes more), but should never &g

Re: [sqlite] step back (again)

2008-03-15 Thread Jay A. Kreibich
On Sat, Mar 15, 2008 at 01:36:49AM -0400, dcharno scratched on the wall: > Jay A. Kreibich wrote: > > You quoted the backward example, but I'm going to use the forward version. > > > > In addition to the "last seen title", remember the RowID for every row

Re: [sqlite] get attributes not supplied by insert

2008-03-15 Thread Jay A. Kreibich
http://www.sqlite.org/lang_createview.html "You cannot COPY, DELETE, INSERT or UPDATE a view. Views are read-only in SQLite. However, in many cases you can use a TRIGGER on the view to accomplish the same thing." -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "&

Re: [sqlite] get attributes not supplied by insert

2008-03-15 Thread Jay A. Kreibich
On Sat, Mar 15, 2008 at 11:52:58PM +0100, Fabiano Sidler scratched on the wall: > Jay A. Kreibich schrieb: > > http://www.sqlite.org/lang_createview.html > > > > "You cannot COPY, DELETE, INSERT or UPDATE a view. Views are > > read-only in SQLite. Howe

Re: [sqlite] Last insert in a table

2008-03-18 Thread Jay A. Kreibich
timestamp column that is auto-set when a row is inserted. This makes it easy to look up the last-inserted row regardless of the rest of the table design. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.&#x

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-18 Thread Jay A. Kreibich
this. Once the statement is prepared, the literal SQL string is no longer needed. The _prepare_v2 calls will keep a copy around, but everything I've seen leads me to believe that this is a private copy that is released with _finalize, and not something the user has to worry about.

Re: [sqlite] Multiple Row Updates

2008-03-22 Thread Jay A. Kreibich
ething goes wrong. It also means the state of your stmt is exactly the same each time you enter your update loop, which can simplify your bind logic if your application/database uses default values. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live i

Re: [sqlite] performance under load

2008-03-24 Thread Jay A. Kreibich
ig thing is that locks are exclusive across the whole database, so an application needs to get it, do what it needs, and get out. A clean database design and proper use of indexes on critical columns (for queries) as well as transactions (for updates) are most likely the first places to look.

Re: [sqlite] Virtual table used to query big external database

2008-04-01 Thread Jay A. Kreibich
s like it would be the common case for INSERTs, UPDATEs, and DELETEs. I suppose a huge delete or a DROP [TABLE|INDEX] might still cause the bitmap to get pretty big, but those are more unusual operations. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who

Re: [sqlite] Count(1)

2008-04-04 Thread Jay A. Kreibich
f the table (which is the same as an index scan), but never actually reads the rows. 'Next' is called, but 'Column' is not. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus sai

Re: [sqlite] Count(1)

2008-04-04 Thread Jay A. Kreibich
re is an extra step in the loop, as the rowid is fetched and passed to count. As I understand it, that rowid value is taken directly out of the B-Tree, however, so you still don't need to read the actual row-record data. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H >

Re: [sqlite] Security for SQLite

2008-04-07 Thread Jay A. Kreibich
f records, etc.) needed to be protected. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006"

Re: [sqlite] Unicode searches

2008-04-07 Thread Jay A. Kreibich
ion. So you can get Unicode aware searching/matching *and* sort-ordering. Perhaps that will fit your needs. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Nin

Re: [sqlite] how to add extensions to amalgamation

2008-04-08 Thread Jay A. Kreibich
the actual C function to the amalgamation file or keep them in your own source files and let the linker figure things out. I guess which you do depends on if you want maximum ease of compiling or minimum changes to the amalgamation (which makes it easier to replicate the changes if/w

Re: [sqlite] Planner choosing wrong index

2008-04-08 Thread Jay A. Kreibich
the same. This appears to be because two NULL values appear to be considered distinct values, so the analysis system sees column a as being full of unique values. That makes the "usefulness" weight of idx_a highly inflated. I have filed a bug on that. We'll see if the de

Re: [sqlite] for function extension in sqlite3

2008-04-08 Thread Jay A. Kreibich
nf.c:34: error: assignment of read-only location > labsinf.c:35: error: assignment of read-only location You're not allowed to modify the buffer referenced by sqlite3_value_text() that's why it returns a const pointer. If you want to modify the returned string, you need to make your o

Re: [sqlite] Is performance of v3.5.7 improved with new bitvec?

2008-04-09 Thread Jay A. Kreibich
On Wed, Apr 09, 2008 at 05:14:33PM +0200, Aladdin Lamp? scratched on the wall: > > Hi all! > Following the recent thread "Virtual tables used to query big external > database", and the discussion with Mike Owens and Jay A. Kreibich, it > seems that : > > - The

Re: [sqlite] Planner choosing wrong index

2008-04-10 Thread Jay A. Kreibich
On Thu, Apr 10, 2008 at 10:30:34AM -0700, Steve Krulewitz scratched on the wall: > On Tue, Apr 8, 2008 at 2:03 PM, Jay A. Kreibich <[EMAIL PROTECTED]> wrote: > > The stat table actually hurts in this case, since the stats for both > > indexes are the same. This appears t

Re: [sqlite] schema design question

2008-04-11 Thread Jay A. Kreibich
hopes to speed up. I'm not sure what the priority of that is, however. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "T

Re: [sqlite] Sqlite question---->how to impose order on query

2008-04-11 Thread Jay A. Kreibich
setup. So this is not the best, but it is still better than the original. (I also assume this is a contrived example, because as-written the ORDER BY clause is pointless thanks to the WHERE clause.) -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who

Re: [sqlite] [noob] merge statement equivalent?

2008-04-11 Thread Jay A. Kreibich
d thread about this second situation about two months ago. If that's the type of thing you're looking to do, have a look a this thread: http://www.mail-archive.com/sqlite-users@sqlite.org/msg31705.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Jay A. Kreibich
d the SYNCHRONOUS=OFF setting correctly, there is no reason the believe the journal files will ever make it out of the operating system's file cache. Even if the OS does decide to spool them off to disk, that's going to happen in an async manner. -j -- Jay A. Kreibich

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Jay A. Kreibich
be sync'ed (especially in a blocking fashion) when close() is called. -j > "Jay A. Kreibich" <[EMAIL PROTECTED]> wrote: On Fri, Apr 11, 2008 at > 03:28:47PM +0200, Martin Engelschalk scratched on the wall: > > Hello Donald, > > > > I don'

Re: [sqlite] schema design question

2008-04-11 Thread Jay A. Kreibich
On Fri, Apr 11, 2008 at 01:54:43PM -0700, Richard Klein scratched on the wall: > Jay A. Kreibich wrote: > >On Thu, Apr 10, 2008 at 05:58:59PM -0700, Richard Klein scratched on the > >wall: > > > >>My advice would be to try it and see. If table creation takes too l

Re: [sqlite] SQL Quick Review/Reference

2008-04-12 Thread Jay A. Kreibich
ome months ago only to discover the PDF version some weeks later. In the end, I ended up buying them both. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja&quo

Re: [sqlite] How to set memory usage as high as possible -- but not too high?

2008-04-14 Thread Jay A. Kreibich
our INSERT transactions, but if you're around 1000 or so, going higher isn't likely to buy you too much. * This upper limit is OS-dependent. I'd use 1.5GB on Windows and older Linux systems, 2.5GB for some of the more modern Linux systems, 3.5GB for Mac OS X. Li

Re: [sqlite] Implicit INDEX?

2008-04-14 Thread Jay A. Kreibich
n (because it is fixed, or because you stashed that value in another table), you could also use a LIMIT clause. That has the added bonus of doing the right thing (even if it takes longer) if the rows somehow get out-of-order. -j -- Jay A. Kreibich < J A Y @ K R E I

Re: [sqlite] in memory or hard disk reading?

2008-04-18 Thread Jay A. Kreibich
h of database data. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006" _

Re: [sqlite] a suggestion to write tutorial for sqlite

2008-04-19 Thread Jay A. Kreibich
to send stuff directly to the address below. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006"

Re: [sqlite] cidr data type

2008-04-20 Thread Jay A. Kreibich
for everything except network_size == 16. You want something closer to (ip_addr & (~(~0 << network_size))) Again, that only works for v4. Part of the beauty of the INET and CIDR types in PostgreSQL is that they take both v4 and v6 addresses/networks and all the operations work on

Re: [sqlite] cidr data type

2008-04-20 Thread Jay A. Kreibich
On Sun, Apr 20, 2008 at 09:29:34AM -0600, Dennis Cote scratched on the wall: > Jay A. Kreibich wrote: > > > > It breaks for everything except network_size == 16. > > > Why do you say that? > > You want something closer to (ip_addr & (~(~0 << ne

Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Jay A. Kreibich
e to a more precise value in order to limit memory usage. > > I do mind using undocumented APIs and will not cry tears if they > change without notice, so any pointers are welcome! See the "Pager" data structure and associated variables and functions in "sqlite-3.5.x/sr

Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Jay A. Kreibich
determine the max number of pages > that have been cached. The default page size is 1024 bytes. The default cache size (in pages) is 2000. (At least according to http://www.sqlite.org/compile.html) -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who l

Re: [sqlite] accented characters upper/lower case in SELECT LIKE statements

2008-05-01 Thread Jay A. Kreibich
7;re only dealing with one language, such as Brazilian-Portuguese, then you can just custom code the various accented characters used in that specific language. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.'

Re: [sqlite] splite database under version control (subversion)?

2008-05-06 Thread Jay A. Kreibich
n your specific situation, it sounds like multiple edits are unlikely. In that case, I'd just add the database files to repository directly and be done with it. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw

Re: [sqlite] multiple updates

2008-05-06 Thread Jay A. Kreibich
this whole thing as a statement to sqlite3_prepare() and step() through it, I would expect the first UPDATE to execute, but none of the others. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said

Re: [sqlite] SQLITE3 datatype

2008-05-07 Thread Jay A. Kreibich
L 0 bytes INTEGER: 1, 2, 3, 4, 6, or 8 bytes, depending on value REAL 8 bytes TEXT size of encoded string BLOB size of blob There are per-value, not per-column (since a column can have different types). -j -- Jay A. Kreibich < J A

Re: [sqlite] SQLITE_BUSY returned from sqlite3_finalize

2008-05-09 Thread Jay A. Kreibich
> successfully, it seems strange if they do. sqlite3_finalize() always does its job. It can return different error codes depending on what it had to do to finalize the statement, but it will always finalize the statement. You're getting a MISUSE on the subsequent calls to _f

Re: [sqlite] Porting into a microcontroller, minimum requirements

2008-05-09 Thread Jay A. Kreibich
guessing the compilers for most of these smaller chips don't support long long ints. Even if they do, it is going to be pretty slow and inflate the code side. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pan

Re: [sqlite] SQLite version 3.5.9

2008-05-14 Thread Jay A. Kreibich
r of I/O operations. Great for lookups and sorts. Not that useful for writes. Depends a lot on how you use the DB. Live dangerously and turn down/off disk syncing (PRAGMA synchronous). Reduces the delay for writes. Dangerous. Or, brute force: Copy the file locally, do your stuff,

Re: [sqlite] SQLite3 C API question

2008-05-14 Thread Jay A. Kreibich
ite-1.14 (http://search.cpan.org/~msergeant/DBD-SQLite-1.14/) uses SQLite 3.4.2. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja", www.

Re: [sqlite] indexing rows from a query

2008-05-16 Thread Jay A. Kreibich
ike to avoid using an OFFSET. Have a look here for more ideas: http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "T

Re: [sqlite] Exceptions to sorting?

2008-05-17 Thread Jay A. Kreibich
ot;for any string A there exists another string B that sorts after A" is the maximum string length. In SQLite that's rather large-- especially to be using as a constant. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in

Re: [sqlite] Equivalent of mysql_real_escape_string() ?

2008-05-17 Thread Jay A. Kreibich
me all of 30 seconds to Google an example of when something like mysql_real_escape_string() breaks: http://ilia.ws/archives/103-mysql_real_escape_string-versus-Prepared-Statements.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo hous

Re: [sqlite] Baffling SQLite statement

2008-05-19 Thread Jay A. Kreibich
ear:1993 > > ..and there are a bunch of them. > > Can anyone spot anything wrong with that query??? Do you really mean for the years to be string literals and not numbers? -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses s

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

2008-05-20 Thread Jay A. Kreibich
fault value? > If I bind that column to NULL I get a constraint error. sqlite3_clear_bindings() resets all of the bindings. http://www.sqlite.org/c3ref/clear_bindings.html -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas

Re: [sqlite] Moving Backwards in SQLite

2008-05-23 Thread Jay A. Kreibich
oving backwards it would be more > > helpful to me. > > http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor This should be in the FAQ. Variations of this question seem to show up on the mailing list about once a week. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C

Re: [sqlite] Speeding up index creation?

2008-05-23 Thread Jay A. Kreibich
ng data into a database chances are you can re-start from scratch if things go wrong. You may also see some performance from setting the temp_store to memory. The biggest single thing is the page cache, however. http://www.sqlite.org/pragma.html PRAGMA page_cache PRAGMA synchronous

Re: [sqlite] Sqlite on RAM

2008-05-27 Thread Jay A. Kreibich
g a RAM disk means going through the OSes file manager, which adds some overhead. On the other hand, you can copy the database file to (or from) a more traditional storage-backed filesystem at any time... something you can't do with a :memory: database. -j -- Jay A. Kreibic

Re: [sqlite] Can't create table from a trigger

2008-05-27 Thread Jay A. Kreibich
site id and its non-unique index. Unless you have a large number of unique ids, relative to the number of rows, the index wouldn't be used anyways. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pa

Re: [sqlite] Setting Precision for Floating Point data

2008-05-30 Thread Jay A. Kreibich
use equality with FP You can, but you might not get the results you expect. > but you can decide that equality is when (A - B) < |N| where N > is the precision and || absolute value. That would be: |(A-B)| < N -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > &quo

Re: [sqlite] Max data in row

2008-05-30 Thread Jay A. Kreibich
ich is an unsigned int (64bit). RowIDs are signed, and every row needs a RowID. From <http://www.sqlite.org/autoinc.html>: ...the largest ROWID is equal to the largest possible integer (9223372036854775807 in SQLite version 3.0.0 and later)... -j

Re: [sqlite] Saving an in-memory database to file

2008-05-30 Thread Jay A. Kreibich
> > sqlite> SELECT * FROM t; > > 1|one > > 2|two > > sqlite> .o foo.sql > > sqlite> .dump > > sqlite> .q > > [12:05 AM] ~/foo$ ls > > foo.sql > > 12:05 AM] ~/foo$ cat foo.sql > > BEGIN TRANSACTION; > > CREATE TABLE t (a, b); > > INSERT INTO "t" VALUES(1,'one

Re: [sqlite] Sqlite on RAM

2008-06-03 Thread Jay A. Kreibich
ace, each time you open the "file" :memory:, a new database structure will be returned. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus s

Re: [sqlite] How to speed up my queries?

2008-06-03 Thread Jay A. Kreibich
fore also after something that cuts off the query after a > certain amount of results have been found. That isn't going to happen unless you can get rid of the ORDER *or* make the ORDER on something that is used as an index. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H &g

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

2008-06-03 Thread Jay A. Kreibich
e3_clear_bindings() that actually *clears* the bindings (e.g. whatever state they are in just after a prepare), and not just sets them to an explicit NULL, as the current function does. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who liv

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

2008-06-03 Thread Jay A. Kreibich
On Tue, Jun 03, 2008 at 02:27:01PM -0600, Dennis Cote scratched on the wall: > Jay A. Kreibich wrote: > > > > That, or something like sqlite3_clear_bindings() that actually > > *clears* the bindings (e.g. whatever state they are in just after a > > prepare), a

Re: [sqlite] rtree extension to use with my data

2008-06-04 Thread Jay A. Kreibich
"R" in "R-Tree" is for rectangle. The structure is designed to hold spaces, not points. You want to do something like: ... rtree(id, long-min, long-max, lat-min, lat-max) For cities where you only have point locations, enter each lat and long twice. -j -- Jay A. K

Re: [sqlite] rtree extension to use with my data

2008-06-04 Thread Jay A. Kreibich
g-min, long-max, lat-min, lat-max) > > > > For cities where you only have point locations, enter each lat and > > long twice. > > Well, my database holds only cities for the time being! Does it make > sense to use rtree then? Sure. Points should be no problem, y

Re: [sqlite] Math Functions

2008-06-05 Thread Jay A. Kreibich
ensions but can modify the SQLite binary, it is very easy to add your own functions directly to the SQLite library. See src/func.c for more info. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said

Re: [sqlite] rtree extension question

2008-06-09 Thread Jay A. Kreibich
as 5 dimensions, or a max of 11 columns (5x2 + 1). -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "'People who live in bamboo houses should not throw pandas.' Jesus said that." - "The Ninja", www

Re: [sqlite] prepare peformances

2008-06-09 Thread Jay A. Kreibich
t; > > > > Bruce Robertson wrote: > >> Can somebody point me to documentation or examples of sqlite prepare > >> statements and their purose? > > ___________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sql

Re: [sqlite] Math Functions

2008-06-12 Thread Jay A. Kreibich
x27;t be pulled into the .so, but it will be noted that if the run-time linker pulls in the extension, it will also need to pull in the math library before it attepts to resolve all the symbols. At least, in theory. What OS are you trying this on? -j -- Jay A. Kreibich < J A Y @ K

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