Re: [sqlite] First time poster: need advise

2012-09-21 Thread Igor Tandetnik
DLL directly. You link with an import library. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] First time poster: need advise

2012-09-21 Thread Igor Tandetnik
on archive? Yes. You would also need an import library - a LIB file. You make one as described at http://support.microsoft.com/kb/131313 . Simply run this command: lib /DEF:sqlite.def LIB tool is found in /bin subfolder of your Visual Studio installatio

Re: [sqlite] SQL:2003 -- Window Functions

2012-09-19 Thread Igor Tandetnik
Mohd Radzi Ibrahim <imra...@gmail.com> wrote: > On Thu, Sep 20, 2012 at 12:58 AM, Igor Tandetnik <itandet...@mvps.org>wrote: > >> On 9/19/2012 12:51 PM, joe.fis...@tanguaylab.com wrote: >> >>> Too bad SQLite doesn't yet support SQL Window Functions.

Re: [sqlite] SQL:2003 -- Window Functions

2012-09-19 Thread Igor Tandetnik
ta between consecutive rows. I've played with some self-join code but that's proving to be complicated. The easiest approach is to maintain the window in your application code, as you iterate over a simple SELECT statement. -- Igor Tandetnik ___ sqlite-use

Re: [sqlite] IN operator hits

2012-09-17 Thread Igor Tandetnik
roposed half-of-a-solution. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Count(*) help

2012-09-17 Thread Igor Tandetnik
the conversion from Acess to SQLite, NULL values turned into empty strings. See what this query returns: select sum(Year2012 is null) CountOfNulls, sum(Year2012 = '') CountOfEmpty from Members; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Getting query results as new records are added

2012-09-14 Thread Igor Tandetnik
On 9/14/2012 10:36 AM, Pavel Ivanov wrote: On Fri, Sep 14, 2012 at 5:58 AM, Igor Tandetnik <itandet...@mvps.org> wrote: Wait a minute. If "statement-level read consistency" only applies to two queries in different transactions, what bearing, if any, does it have on your example

Re: [sqlite] SQLite Compile Bug for Windows 8

2012-09-14 Thread Igor Tandetnik
Chang Li <changli...@hotmail.com> wrote: > At line 14573 require add (char *) for convert from (void *) > > z = (char *)sqlite3DbMallocRaw(db, (int)n); Are you, by any chance, trying to compile in C++ mode? SQLite is written in C, where such a cast is not required. --

Re: [sqlite] Getting query results as new records are added

2012-09-14 Thread Igor Tandetnik
to two queries in different transactions, what bearing, if any, does it have on your example of "open, fetch, update, fetch"? There, everything happens in the same transaction. I'm thoroughly confused. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Getting query results as new records are added

2012-09-13 Thread Igor Tandetnik
Pavel Ivanov <paiva...@gmail.com> wrote: > On Thu, Sep 13, 2012 at 3:36 PM, Igor Tandetnik <itandet...@mvps.org> wrote: >> On 9/13/2012 4:39 PM, Petite Abeille wrote: >>> >>> >>> On Sep 13, 2012, at 10:24 PM, Igor Tandetnik <itandet...@mvps.org

Re: [sqlite] c++ - Tell SQLite3, read the subsequent rows

2012-09-13 Thread Igor Tandetnik
ment = s; > if (mystmt == NULL) { rc = sqlite3_prepare_v2(db, SQLStatement.c_str(), -1, > ,NULL); } > if(rc != SQLITE_OK) {...} > rc = sqlite3_step(mystmt); > } You seem to be calling sqlite3_step when sqlite3_prepare_v2 has just failed. Th

Re: [sqlite] Getting query results as new records are added

2012-09-13 Thread Igor Tandetnik
On 9/13/2012 4:39 PM, Petite Abeille wrote: On Sep 13, 2012, at 10:24 PM, Igor Tandetnik <itandet...@mvps.org> wrote: In other words, a select should only ever see what existed at the beginning of the query, and that is that. Again, the concept of isolation level applies to transa

Re: [sqlite] Getting query results as new records are added

2012-09-13 Thread Igor Tandetnik
On 9/13/2012 4:14 PM, Petite Abeille wrote: On Sep 13, 2012, at 9:30 PM, Igor Tandetnik <itandet...@mvps.org> wrote: If records are added by the same transaction that runs the SELECT statements, then they may or may not be observed (imagine for example that the statement has an

Re: [sqlite] Getting query results as new records are added

2012-09-13 Thread Igor Tandetnik
out having to repeat the whole query and weed out the results we're already showing? Put a timestamp on each row, rerun the query with "timestamp > :lastSeenTimestamp" condition. -- Igor Tandetnik ___ sqlite-users mailing list sqlit

Re: [sqlite] Library routine called out sequence error.

2012-09-12 Thread Igor Tandetnik
Donald Steele <xln...@sbcglobal.net> wrote: >sqlite3_close(contactDB); >NSLog(@" error '%s", sqlite3_errmsg(contactDB) ); The error is produced not by sqlite3_prepare_v2 but by sqlite3_errmsg, as you are calling it on an already-closed hand

Re: [sqlite] C++ - HOW MANY rows?

2012-09-12 Thread Igor Tandetnik
sand times after each such attempt, you run the risk of outstaying your welcome. I need to know how this thing works! Which part, specifically, do you find unclear? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlit

Re: [sqlite] C++ - HOW MANY rows?

2012-09-11 Thread Igor Tandetnik
roblem is in design Indeed. > but I don't have enough experience using SQLite3 to come up with a better > idea. In this case, perhaps you should consider using, or at least studying, some existing libraries. There's no shortage of them: http://www.sqlite.org/cvstrac/wiki?p=S

Re: [sqlite] C++ - HOW MANY rows?

2012-09-11 Thread Igor Tandetnik
On 9/11/2012 7:37 PM, Igor Tandetnik wrote: On 9/11/2012 7:28 PM, Arbol One wrote: This works just fine, but it only reads the first row Of course. You only ever call sqlite3_step step after prepare and before finalize. I mean, you only ever call sqlite3_step *once* after prepare and before

Re: [sqlite] C++ - HOW MANY rows?

2012-09-11 Thread Igor Tandetnik
to call sqlite3_step repeatedly, for as long as it returns SQLITE_ROW. Every call fetches a new row. When sqlite3_step returns SQLITE_DONE, there are no more rows. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org

Re: [sqlite] selecting real values

2012-09-11 Thread Igor Tandetnik
t IEEE floating point number - those are accurate to about 15 decimal digits (52 bits of mantissa / log2(10)). The shell formats them with printf("%g") - this defaults to 6 digits after the period. -- Igor Tandetnik ___ sqlite-users

Re: [sqlite] instr function or equivalent

2012-09-10 Thread Igor Tandetnik
of substr and length before implementing instr, to make sure the three play well together. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] instr function or equivalent

2012-09-10 Thread Igor Tandetnik
On 9/10/2012 12:45 PM, Simon Slavin wrote: Similar but it only every has to (recursively) look at the rightmost character. 'instr' has to be able to look at substrings all the way along the string. So does replace(), which SQLite does implement. -- Igor Tandetnik

Re: [sqlite] Can this be done in one query?

2012-09-08 Thread Igor Tandetnik
very similar problem was discussed extensively just the other day. See this thread: http://www.mail-archive.com/sqlite-users@sqlite.org/msg72319.html -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Igor Tandetnik
On 9/6/2012 12:14 PM, Arbol One wrote: rc = sqlite3_step(mystmt); if(rc == SQLITE_ROW ) { The code, in this case, does not process this statement!!?? It's possible that no row actually matches the condition, so sqlite3_step returns SQLITE_DONE on the first call. -- Igor Tandetnik

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
On 9/5/2012 9:53 PM, Yuriy Kaminskiy wrote: Igor Tandetnik wrote: On 9/5/2012 12:38 PM, E. Timothy Uy wrote: I have a column in table 'alpha' which I would like to populate with data from table 'beta'. As far as I know, we cannot do an UPDATE using JOIN in sqlite, but we can UPDATE alpha SET

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
On 9/5/2012 4:54 PM, Petite Abeille wrote: On Sep 5, 2012, at 10:38 PM, Igor Tandetnik <itandet...@mvps.org> wrote: A select statement that would most closely resemble your update statement would look like this: select frequency, (select frequency from beta where beta.term = alph

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
On 9/5/2012 4:35 PM, Igor Tandetnik wrote: On 9/5/2012 4:32 PM, E. Timothy Uy wrote: Igor, what happens if there are multiple hits for SELECT frequency FROM beta WHERE beta.term = alpha.term There can't be multiple hits, or even a single hit. This statement will not run, as it's

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
On 9/5/2012 4:32 PM, E. Timothy Uy wrote: Igor, what happens if there are multiple hits for SELECT frequency FROM beta WHERE beta.term = alpha.term There can't be multiple hits, or even a single hit. This statement will not run, as it's not syntactically valid. -- Igor Tandetnik

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
, I'm tired and that's incoherent. I hope you followed it.) If you have 1000 records in the two tables that match each other, every record in the alpha table will be updated 1000 times. No, that's not true. Every record in alpha will be updated exactly once. -- Igor Tandetnik

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
, this update statement would have a query plan very similar to the one for select alpha.frequency, beta.frequency from alpha, beta where beta.term = alpha.term; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080

Re: [sqlite] classic update join question

2012-09-05 Thread Igor Tandetnik
= alpha.term) Will the database really be doing a select in beta for every single line in alpha? Yes - same as when implementing a join. How do you think a join is performed - black magic? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Finding rows with MIN(MTIME) for all IDs

2012-09-05 Thread Igor Tandetnik
zards of comparing floating point numbers for equality, right? This applies when the floating point number is the result of calculations. If you just read a number twice from the same source, the two copies should compare equal just fine. -- Igor Tandetnik __

Re: [sqlite] (no subject)

2012-09-05 Thread Igor Tandetnik
ing) http://en.wikipedia.org/wiki/STL_(file_format) http://en.wikipedia.org/wiki/Statement_List Also, how is your question related to SQLite? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] Finding rows with MIN(MTIME) for all IDs

2012-09-05 Thread Igor Tandetnik
lect 1 from tab t2 where t2.id = t1.id and t2.mtime > t1.mtime) ORDER BY mtime DESC; I believe these queries are standard, but are likely to be much slower than the original. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Sqlite Query Optimization (using Limit and Offset)

2012-09-05 Thread Igor Tandetnik
sattu <linkpr...@rocketmail.com> wrote: > select * from myTable LIMIT 100 OFFSET 0 //Execution Time is less than > 1sec > select * from myTable LIMIT 100 OFFSET 95000 //Execution Time is almost > 15secs http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor

Re: [sqlite] how to re_update the id item

2012-09-03 Thread Igor Tandetnik
you are trying to achieve. Perhaps something like this: create temp table OldIds(id integer primary key); insert into OldIds select id from MyTable; update MyTable set id=1+(select count(*) from OldIds where OldIds.id < MyTable.id); drop table OldIds;

Re: [sqlite] to table update

2012-08-23 Thread Igor Tandetnik
yanhong.ye <y...@sohu.com> wrote: > update tb1 set col1=(select col1 from tb2 ) where tb1.co2=tb2.co2; The closing parenthesis is in the wrong place: update tb1 set col1=(select col1 from tb2 where tb1.co2=tb2.co2); -- Igor Tandetnik _

Re: [sqlite] update moving avg value

2012-08-22 Thread Igor Tandetnik
ct numerators of the two fractions (avg(x) is a fraction of sum(x)/count(x)) when their denominators are different. 1/2 + 1/3 != 2/5 -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] update moving avg value

2012-08-22 Thread Igor Tandetnik
0 update test2 set diff = round( (select avg(b.close) from test2 b where b.tkid between test2.tkid-12 and test2.tkid) - (select avg(b.close) from test2 b where b.tkid between test2.tkid-26 and test2.tkid) , 2); -- Igor Tandetnik ___ sqlite-us

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

2012-08-21 Thread Igor Tandetnik
e code and message set by "sqlite3_step()" in case of error? There doesn't indeed appear to be any way to set both error code and message. You can set one or the other (with sqlite_result_error_code or sqlite_result_error correspondingly), but not both. -

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

2012-08-21 Thread Igor Tandetnik
suite and documentation to show how > it is done? Example of which mechanism? > * If the nested statement execution fails for some reason: > is there some convention about how the app-defined SQL > function should signal the error to its caller? sqlite3_result_error* -- Igor

Re: [sqlite] Update with nested selected

2012-08-15 Thread Igor Tandetnik
ND TimeStamp = > date(updateData.TimeStamp, '-1 day')); > > I want to update the FieldA with FieldB one day earlyer, where IDField is the > same. update TableA set FieldA = ( select FieldB from TableA t where t.IDField = TableA.IDField and t.TimeStamp = date(TableA.TimeStamp,

Re: [sqlite] How to recognize a sqlite database file?

2012-08-13 Thread Igor Tandetnik
daedae11 <daeda...@126.com> wrote: > If I use the group of: > sqlite3_prepare16_v2() > sqlite3_step() > andsqlite3_finalize() > > how can I get the names of a table's columns from a SELECT sql sentence? sqlite3_column_name

Re: [sqlite] EXT :Re: Multi-Thread Reads to SQLite Database

2012-08-10 Thread Igor Tandetnik
the in-memory data structure representing the cache may be modified even by read-only transactions. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Select rows where a column is not unique

2012-08-06 Thread Igor Tandetnik
On 8/6/2012 9:24 AM, Rob Richardson wrote: Which of those would be fastest? Or don't you have enough information to tell? Hard for me to predict. If it were important to me, I'd test and time all of them on a realistic dataset. -- Igor Tandetnik

Re: [sqlite] Select rows where a column is not unique

2012-08-06 Thread Igor Tandetnik
nt(*) from MyTable t2 where t2.SpecificColumn = t1.SpecificColumn); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Igor Tandetnik
Simon Slavin <slav...@bigfraud.org> wrote: > All INTEGER PRIMARY KEY columns automatically have AUTOINCREMENT. You should > not specify it yourself. There's a subtle difference in behavior with and without AUTOINCREMENT keyword. See http://www.sqlite.org/autoinc.html -- Ig

Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Igor Tandetnik
Brandon Pimenta <brandonskypime...@gmail.com> wrote: > CREATE TABLE test ( > test_1 INTEGER PRIMARY KEY NOT NULL AUTOINCREMENT > ); Make it INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL Though NOT NULL is redundant - PRIMARY KEY implies it. --

Re: [sqlite] AUTO_INCREMENT error

2012-08-03 Thread Igor Tandetnik
this query gives me "SQL error: near "AUTO_INCREMENT": syntax error". > What does this mean? It means that yours is not a syntactically valid SQL statement. The error message seems pretty clear to me. -- Igor Tandetnik ___ sqlite-

Re: [sqlite] query function release problem

2012-08-02 Thread Igor Tandetnik
malloc'ed, and you haven't malloc'ed either of them. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] UNION ALL with queries that have a different number ofcolumns

2012-07-29 Thread Igor Tandetnik
gt; of columns would return an error. If I remove the outermost SELECT * > then I receive the error I'm expecting: SELECTs to the left and right > of UNION ALL do not have the same number of result columns. Looks like a bug to me, for what it's worth. -- Igor Tandetnik

Re: [sqlite] How to query data in table more than 2?

2012-07-28 Thread Igor Tandetnik
黃楨民 <huangchen...@gmail.com> wrote: > I would like to query customer from from ooder table and only customer > order more than twice. select CustomerId from Orders group by CustomerId having count(*) > 2; -- Igor Tandetnik ___ sqlit

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread Igor Tandetnik
the shortest duration (the smallest timedelta) using the SQLite MIN(), like so: SELECT MIN(duration) FROM Durations Something like this perhaps: select min(substr('0', 1, 15-length(duration)) || duration) from Durations; -- Igor Tandetnik ___ sqlite-users

Re: [sqlite] C++ - nothing has been stored!!??

2012-07-24 Thread Igor Tandetnik
them. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] single gdbconn object with multiple threads.

2012-07-23 Thread Igor Tandetnik
. You are adding complexity but are not gaining any performance out of it. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] A matter of UNIQUEness

2012-07-23 Thread Igor Tandetnik
EY column (when spelled exactly this way) is special: http://sqlite.org/lang_createtable.html#rowid -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] single gdbconn object with multiple threads.

2012-07-23 Thread Igor Tandetnik
ce for reader_threads? What's "tbb"? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] database AND table already exist?

2012-07-20 Thread Igor Tandetnik
Black, Michael (IS) <michael.bla...@ngc.com> wrote: > Good pointso probably time equivalent either way. Though table_info will > allow the feature creep of "does a column exist" > pretty easily. So would preparing a statement of the form "select ColumnToCheck

Re: [sqlite] database AND table already exist?

2012-07-20 Thread Igor Tandetnik
Black, Michael (IS) <michael.bla...@ngc.com> wrote: > table_info() will be faster than doing "select *" I would think in most all > cases. To check the existence of a table, you don't need to actually run the select statement - just prepare it and check for erro

Re: [sqlite] sqlite4 in memory databases

2012-07-16 Thread Igor Tandetnik
On 7/16/2012 8:23 PM, Carlos Milon Silva wrote: Are there any plans to sqlite4 implement these pending feature requests of sqlite3? Dumping to, and restoring from disk an sqlite memory database. http://sqlite.org/c3ref/backup_finish.html -- Igor Tandetnik

Re: [sqlite] record number after reordering

2012-07-16 Thread Igor Tandetnik
On 7/16/2012 4:19 PM, Luis Mochan wrote: What are the pros and cons of this approach vs. using a temporal table as suggested by Keith? My technique doesn't require a temp table so may be somewhat easier to use. On the other hand, I suspect it might be much slower on a large table. -- Igor

Re: [sqlite] set of db connections

2012-07-16 Thread Igor Tandetnik
t in time - one of them will block the other. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] set of db connections

2012-07-16 Thread Igor Tandetnik
be precise, with WAL you can have one writer and multiple readers at any point in time. Without WAL, it's one writer OR multiple readers. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] record number after reordering

2012-07-15 Thread Igor Tandetnik
esive values. Something like this perhaps: select avg(a) from MyTable t1 group by (select count(*) from MyTable t2 where t2.a < t1.a) / 10; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how many rows deleted

2012-07-11 Thread Igor Tandetnik
On 7/11/2012 7:21 PM, deltagam...@gmx.net wrote: Can I retrieve how many rows are affected from a delete statement sqlite3_changes -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] Selecting NULL

2012-07-11 Thread Igor Tandetnik
ich is not the same as null. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite4 key encoding bug

2012-07-10 Thread Igor Tandetnik
when doing the key encoding. Both 123.0 and 12323.0 should be exactly representable in a double, as far as I can tell. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite4 key encoding bug

2012-07-10 Thread Igor Tandetnik
/string). Could you explain why 123 and 123.0 got grouped together, but 12323 and 12323.0 did not? Shouldn't the same logic apply? It's this inconsistency that looks qutie suspicious. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-user

Re: [sqlite] Using the SQLite Online Backup AP

2012-07-09 Thread Igor Tandetnik
ot; technique of copying the physical database file - a technique that predates backup API. It is with the goal of overcoming the shortcomings of this technique, of which you cite one, that backup API was invented. -- Igor Tandetnik ___ sqlite-users mailing

Re: [sqlite] DELETE only deletes some records, not others

2012-07-09 Thread Igor Tandetnik
way is to use sqlite3 command line utility. Run .dump on the old database, then .read on the new empty one. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] DELETE only deletes some records, not others

2012-07-08 Thread Igor Tandetnik
AGMA integrity_check; , see what it says. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug in sqlite3_step

2012-07-04 Thread Igor Tandetnik
t sqlite3_prepare_v2 to prepare, if table and column could vary afterwards? Also, what are sqlite3_column_count, sqlite3_column_decltype et al supposed to return? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug in sqlite3_step

2012-07-03 Thread Igor Tandetnik
Robert Myers <rob.my...@ziften.com> wrote: > DROP TABLE ? would've been useful for me. Parameters can only appear where literals would be allowed by the syntax. A table name is not a literal. -- Igor Tandetnik ___ sqlite-users mailing li

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

2012-07-03 Thread Igor Tandetnik
oint is that the key is constructed in such a way that both procedures would arrive at the same result. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug in sqlite3_step

2012-07-03 Thread Igor Tandetnik
ly parameterize DML statements - SELECT, INSERT, UPDATE and DELETE. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] max size of a TEXT field

2012-07-02 Thread Igor Tandetnik
On 7/2/2012 4:02 PM, deltagam...@gmx.net wrote: I couldnt find in the documentation what the max size of TEXT field/column is. There's no set limit. As much as can fit into memory, basically. -- Igor Tandetnik ___ sqlite-users mailing list sqlite

Re: [sqlite] Not sure how to interrupt this

2012-06-28 Thread Igor Tandetnik
Jeff Archer <jarch...@yahoo.com> wrote: >> Igor Tandetnik itandetnik at mvps.org Thu Jun 28 09:38:27 EDT 2012 >> My guess is that a) you have prepared your statement with > sqlite3_prepare_v2 (as opposed to sqlite3_prepare)... > > > Statement was prep

Re: [sqlite] Not sure how to interrupt this

2012-06-28 Thread Igor Tandetnik
Marc L. Allen <mlal...@outsitenetworks.com> wrote: > How could the schema have changed? Someone ran CREATE TABLE or VACUUM or similar on the database (possibly via a different connection). -- Igor Tandetnik ___ sqlite-users mailing list sql

Re: [sqlite] Not sure how to interrupt this

2012-06-28 Thread Igor Tandetnik
lite3_prepare), and b) the schema did in fact change between the time the statement was prepared and the time it got executed. In this case, SQLite would internally intercept SQLITE_SCHEMA (but apparently, not before logging it), then finalize, re-prepare and re-execute

Re: [sqlite] SQLite only supports TYPE_FORWARD_ONLY cursors

2012-06-27 Thread Igor Tandetnik
PE_SCROLL_INSENSITIVE cursors? I doubt it. This is not a limitation of the drivers, but of SQLite itself. The only operation it supports on its equivalent of a cursor is "advance to next row". -- Igor Tandetnik ___ sqlite-users mailing li

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Igor Tandetnik
On 6/26/2012 4:02 PM, Pavel Ivanov wrote: On Tue, Jun 26, 2012 at 3:02 PM, Igor Tandetnik <itandet...@mvps.org> wrote: On 6/26/2012 1:19 PM, Peter Haworth wrote: I still have the issue that, in order to be selected, the rows in the groups containing two entries must have a different

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Igor Tandetnik
this: SELECT * from TableA WHERE z in ( SELECT z FROM TableA GROUP BY z HAVING count(*)=2 and min(otherColumn) != max(otherColumn) ); -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo

Re: [sqlite] Detecting when a table is created

2012-06-26 Thread Igor Tandetnik
Vivien Malerba <vmale...@gmail.com> wrote: > Is there any possibility to be notified when a table is created (when a > "CREATE TABLE XXX" is executed)? How is it executed? Isn't it your program that executes the statement? How come you don't know when that happe

Re: [sqlite] How to retrieve number of records

2012-06-26 Thread Igor Tandetnik
Simon Slavin <slav...@bigfraud.org> wrote: > Use sqlite3_result_int(stmt, 0) to get the value of the first (only) column > of the row. Make it sqlite3_column_int. sqlite3_result_* is used inside custom functions, to set the return value of the function call. -- Ig

Re: [sqlite] C++ - ISERT from a data object

2012-06-25 Thread Igor Tandetnik
uot;, -1, , NULL); string name = "Caramba"; string address = "490 New Bridge"; int age = 49; sqlite3_bind_text(stmt, 1, name.c_str(), name.length(), SQLITE_STATIC); sqlite3_bind_text(stmt, 2, address.c_str(), address.length(), SQLITE_STATIC); sqlite3_bind_int(

Re: [sqlite] C++ programming - creating a table

2012-06-25 Thread Igor Tandetnik
data do you expect there to be right after CREATE TABLE? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-25 Thread Igor Tandetnik
't even have to be a separate DLL - you can statically link it directly into your application. You can further reduce the size of the binary by omitting features you don't need: http://sqlite.org/compile.html -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] C++ programming - inserting data in a table

2012-06-24 Thread Igor Tandetnik
Arbol One <arbol...@gmail.com> wrote: > Thanks for the prompt response. > Here is the same problem when using INSERT. Which part of "INSERT ... statement [doesn't] produce a resultset; thus, sqlite3_column_* functions couldn't be used with [it]" do you have difficulty u

Re: [sqlite] C++ programming - creating a table

2012-06-24 Thread Igor Tandetnik
purpose of sqlite3_column_type call? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] C++ programming - getting data from a table

2012-06-24 Thread Igor Tandetnik
sqlite3_finalize(stmt); sqlite3_close(db); Error handling is left as an exercise for the reader. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] C++ programming - SELECT question

2012-06-24 Thread Igor Tandetnik
Arbol One <arbol...@gmail.com> wrote: > A pessimist is one who makes difficulties of his opportunities and an > optimist is one who makes opportunities of his difficulties. Is there a question in there somewhere? -- Igor Tandetnik ___

Re: [sqlite] Counting entries returned from a compound SELECT.

2012-06-21 Thread Igor Tandetnik
On 6/21/2012 4:07 PM, Peter Haworth wrote: Hoping someone can provide a way to return a count of the number of entries returned by a compound SELECT statement, specifically "SELECT …. EXCEPT SELECT….". select count(*) from (); -- Igor

Re: [sqlite] Difference between 3.7.11 and 3.7.13

2012-06-21 Thread Igor Tandetnik
g(SomeConstExpr) from t2" would return NULL rather than SomeConstExpr if t2 is empty. So it should be equivalent to select max(case when (select count(*) from t2) == 0 then null else x end) from t1; -- Igor Tandetnik ___ sqlite-users maili

Re: [sqlite] Difference between 3.7.11 and 3.7.13

2012-06-21 Thread Igor Tandetnik
o any expression, even one that happens to be constant across all rows of the table. I don't understand what makes this query invalid. Pointless, yes, but why invalid? -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sql

Re: [sqlite] sqlite compound keys

2012-06-21 Thread Igor Tandetnik
te management tool, run this query: EXPLAIN QUERY PLAN select * from tmp where x = 9; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to select from table

2012-06-20 Thread Igor Tandetnik
yTable; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-19 Thread Igor Tandetnik
ny of the third-party tools listed here: http://www.sqlite.org/cvstrac/wiki?p=ManagementTools It appears that your program lacks cleanup actions. Call sqlite_finalize on every prepared statement once you no longer need it. Then, call sqlite3_close on a database connection once you no longer ne

Re: [sqlite] insert in db

2012-06-18 Thread Igor Tandetnik
in two different directories. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Insert and select date and time

2012-06-18 Thread Igor Tandetnik
t sure I understand the nature of the problem. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] C++ programming - int sqlite3_prepare_v2() question

2012-06-18 Thread Igor Tandetnik
_step: " << rc << std::endl; > exit(-3); > } > Any suggestions? None. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

<    4   5   6   7   8   9   10   11   12   13   >