Re: [sqlite] Last insert in a table

2008-03-18 Thread Dennis Cote
w = last_insert_rowid() where table_name = 't2'; end; Now when you need the last inserted row for a particular table you can get it by querying the last_inserted_rows table. select last_inserted_row from last_inserted_rows where table_name = :table_n

Re: [sqlite] How to decode a date

2008-03-18 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > > I would like to know how to decode a Date when I read a table. The same > question for Time. > See http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions for details. HTH Dennis Cote ___ sqlite-users

Re: [sqlite] Preventing Master Journal Files

2008-03-18 Thread Dennis Cote
s. You can change the synchronous pragma to off to get most of the speed benefits of operation without a journal, but the file will still be created. Execute "pragam synchronous = off" to disable file syncs, and when done, execute "pragma synchronous = full" to return

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-18 Thread Dennis Cote
print(); rc=sqlite3_step(Statement); if (rc!=SQLITE_DONE) { // SQLITE_CONSTRAINT error abort = 1; // uncomment this line to report errors error_print(); // comment this line to ignore errors break; } sqlite3_r

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-17 Thread Dennis Cote
you have an existing database you can drop the old index and create the new index without losing any data. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Dennis Cote
ep c or step d. The advantage of this is that it prevents some other process form executing a delete between your steps a and c for example. If the file existed when your process A did its existence check as step a, but didn't exist when it got to step c, there would be problems (not the problems you are se

Re: [sqlite] Performance degradation after upgrade to 3.5.x on slow flash cards

2008-03-17 Thread Dennis Cote
flash card with the database from the device. I would suggest using a modified SQLite only as a last resort. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Dennis Cote
Bharath Booshan L wrote: > > I will give overview of what is happening > > App A - Writer process > --- > * Open SQLIte Connection > * BEGIN IMMEDIATE TRASACTION > * Insert/Update some 1000 rows in Table A,B,C > * COMMIT > * Close SQLite connection >

Re: [sqlite] Complex SELECT Syntax

2008-03-17 Thread Dennis Cote
re isn't enough information here to make any sense of what you have written, or what you are asking. > This is how they are used > The items above don't appear anywhere in the SQL you posted. You will have to be more specific in your question if you want to get a

Re: [sqlite] SQLITE_CONSTRAINT error after sqlite3_step

2008-03-17 Thread Dennis Cote
ded a unique index to this column which will raise a constraint error if you try to insert a row that has the same value in that column as some other row. If you don't really require that the Tag column data be unique for each row, then change your index to o normal index without t

Re: [sqlite] table names from subselects?

2008-03-14 Thread Dennis Cote
wrong thing. Try this instead: select * from (select user.id as id from user ) where id=1 ; If you want the subselect result to have a name then you can do this: select * from (select user.id as id from user ) as sub where sub.id=1; HTH Dennis Cote ___

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

2008-03-14 Thread Dennis Cote
can always use this optimization, and will in fact never pull data from the table itself for a query that uses the index. The table (along with the index) will only be accessed when rows are inserted, updated, or deleted. Dennis Cote ___ sqlite-users mailing li

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

2008-03-14 Thread Dennis Cote
short, as usual, it depends. :-) HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Value between changes

2008-03-14 Thread Dennis Cote
nversion can also be eliminated to give: select code, sum( (select l2.timestamp from Log l2 where l2.timestamp > l1.timestamp order by timestamp limit 1 ) - timestamp) from Log l1 group by code; HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] newB question; c++ and sqlite3; how2 check if word exist in the table

2008-03-14 Thread Dennis Cote
will be inserted into table tbl1. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] REPLACE INTO not increase field value?

2008-03-13 Thread Dennis Cote
would be the item to match on. In your case, if the combination of Material and Name is a primary key, then it should be quite fast. If it's not, then making them a primary key, or adding an index on those columns will help. HTH Dennis Cote ___ sqlite

Re: [sqlite] NFS SQLITE problem

2008-03-13 Thread Dennis Cote
problems. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Very large database

2008-03-13 Thread Dennis Cote
ent tells the function to save the SQL so it can be recompiled later if need be. What kind of problems are you having? Can you be more specific. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] REPLACE INTO not increase field value?

2008-03-13 Thread Dennis Cote
e record exists, its Qnt value will be incremented and inserted as a replacement record. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] A few question using sqlite

2008-03-12 Thread Dennis Cote
of the list view. The list view can give all > information about viewing area(top position, bottom position). See http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor for additional info. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Param Binding Problem

2008-03-12 Thread Dennis Cote
it is a parameter inthe query that you can bind some string value to later. > > nError from the prepare is SQLITE_OK but from the bind its SQLITE_RANGE > This is because you don't have any parameters to be bound. HTH Dennis Cote ___ sqli

Re: [sqlite] Why doesn't "where =" work for text field

2008-03-12 Thread Dennis Cote
ld try trimming those values instead. Select name from PerfTest1 where trim(name) = 'key5000'; > This works: > > Select name from PerfTest1 where name like '%key5000%'; > That is because this query matches names that have trailing and/or leadi

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-12 Thread Dennis Cote
= SQLITE_OK) { //process error } > > however when i do: > > select * from Images; > To dump the blob data in a human readable format you could use the hex() SQL function. It will display each byte of the blob as two ASCII characters that correspond to the hexadecimal val

Re: [sqlite] SQL Blobs - what am i doing wrong here?(code inside)

2008-03-11 Thread Dennis Cote
> prepare statement being successful or nothing happens > at all when clearly i did and clearly the status was > ok too since i didnt get an error message there. > I'm not sure why the finalize would fail, unless perhaps your prepare also failed, and you didn't have a valid statemen

Re: [sqlite] SQL Newbie problem I guess...

2008-03-11 Thread Dennis Cote
:\MP3\Albums\Abba - Definitive Collection\'); insert into Folders values(3,2,1,'C:\MP3\Albums\Abba - Definitive Collection\cd1\'); insert into Folders values(4,2,1,'C:\MP3\Albums\Abba - Definitive Collection\cd2\'); SELECT folderid FROM Folders WHERE path LIKE 'C:\MP3\Albums\' || '%'; DELETE FR

Re: [sqlite] Generating new rowid algo

2008-03-11 Thread Dennis Cote
utoinc.html for full details. This keyword may be the solution to the OPs ocncerns as well. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Update fail without ERRORS

2008-03-10 Thread Dennis Cote
ngs back here. Also I noticed that you are using different case (zSQL vs zSql) in the calls to sqlite3_mprintf() and sqlite3_exec(). I assume that is another typo. It really would be best if you could post the actual code you were running to avoid such issues. HT

Re: [sqlite] Update fail without ERRORS

2008-03-10 Thread Dennis Cote
running as a different user than the command line shell program, and that user doesn't have write permission to the file or directory which are needed to create the journal file and to modify the database file. I would have expected an error message return from sqlite3_exec(

Re: [sqlite] newB question; c++ and sqlite3; how2 check if word exist in the table

2008-03-10 Thread Dennis Cote
(select word from other_table where word = :word) HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Odd problem with select on large table

2008-03-07 Thread Dennis Cote
length(trim(name)); It should display any names that have leading or trailing spaces with a colon on each end so the spaces become visible. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to recover from database corruption? (and why does it happen?)

2008-03-05 Thread Dennis Cote
tegrity checks on the database in order to try to determine when the corruption occurred in case it happens again. This process would log the success or failure of each check. This may greatly reduce the number of operations you have to consider prior to a failure if the corruption happens again.

Re: [sqlite] A beginner question

2008-03-05 Thread Dennis Cote
ite3 test.db SQLite version 3.5.6 Enter ".help" for instructions sqlite> create table t(a,b); sqlite> .quit C:\Documents and Settings\DennisC> If you don't specify a filename on the command line sqlite3 uses an in memory database which is lost when you

Re: [sqlite] binding to missing indexes with ?NNN parameters is odd

2008-03-05 Thread Dennis Cote
ssing indexes are missing, > parameter_index and parameter_name don't provide any indication? > No there isn't because the indexes aren't missing. The correct number of variables are associated with the query. Some of them may not be bound to other values, and will therefore ha

Re: [sqlite] Binding values for IN ?

2008-03-05 Thread Dennis Cote
Michael Schlenker wrote: > > n is an integer primary key..., is LIMIT better than a where condition in > that case? > No. Looking at the explain output it looks like six of one half dozen of the other. Dennis Cote ___ sqlite-users

Re: [sqlite] Binding values for IN ?

2008-03-05 Thread Dennis Cote
n do it any faster than SQLite is doing for the subquery. There is probably no benefit unless you want to reuse the temp table for several meta table queries. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Performance.....

2008-03-05 Thread Dennis Cote
ly the last value every 250 ms, then you should have no trouble. If you are trying to redraw a scrolling graph of the last 400 samples every 250 ms you may have issues to be concerned about. Dennis Cote ___ sqlite-users mailing list sqlite-users@s

Re: [sqlite] Binding values for IN ?

2008-03-05 Thread Dennis Cote
uid_sets table. This may be simpler if you reuse the sets often. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to recover from database corruption? (and why does it happen?)

2008-03-05 Thread Dennis Cote
in such a > case, please tell so). Your questions aren't too stupid, just a little vague and without enough detailed context info for anyone to offer much real assistance. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] PRAGMA auto_vacuum

2008-03-04 Thread Dennis Cote
n the database, as noted in the documentation. > Therefore, auto-vacuuming must be turned on > before any tables are created. It is not possible to enable or > disable auto-vacuum after a table has been created. HTH Dennis Cote ___ sqlite-users mailing l

Re: [sqlite] Can I automatically create a 'disambiguation' number in a second field of a primary key?

2008-03-03 Thread Dennis Cote
group talker listener -- -- -- -- 1 1 11 12 1 2 15 47 2 1 11 22 2 2 37 15 3 1 22 11 3 2

Re: [sqlite] "database is locked" on clean install, empty database?

2008-03-03 Thread Dennis Cote
he same directory for you to make any changes. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Can I automatically create a 'disambiguation' number in a second field of a primary key?

2008-03-03 Thread Dennis Cote
This should produce the following table with a unique unambiguous id for each communication. id group talker listener 11 11 12 21 11 22 31 22 11 41 22 12 51 34 11 61 34 12 71 34 22 8

Re: [sqlite] Does or will Sqlite provide a DUMP mechanism?

2008-03-03 Thread Dennis Cote
ave your program start an exclusive transaction before the copy,and roll it back after the copy. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] PRAGMA auto_vacuum

2008-03-03 Thread Dennis Cote
is not possible to enable or > disable auto-vacuum after a table has been created. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] error downloading extensions / contributions

2008-03-03 Thread Dennis Cote
ite. > Not quite. First you have to compile the functions into a dll library, then use the command you showed to load that library. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] since when was fts3 included in binary?

2008-03-03 Thread Dennis Cote
Rael Bauer wrote: >> According to the web page, 3.5.3. > > Which web page is that? > Probably http://www.sqlite.org/changes.html HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/

Re: [sqlite] C++ api - callbacks problem

2008-03-03 Thread Dennis Cote
rough to the callback method using the context argument above. Then you can call the instance methods for that particular object. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Retrieve Rownumber in sqlite

2008-03-03 Thread Dennis Cote
rds in Table. Is there > any function available in SQLite similar to this. > See http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor for a discussion of paging results that is fast and does not require a row_number for the entries. HTH Dennis Cote __

Re: [sqlite] Update fail without ERRORS

2008-03-03 Thread Dennis Cote
match your update condition? select count(*) from your_table where Address=7 and Port=1 If that gives a zero result you have your answer. You might also want to show the create statement you used for the table you are trying to update. HTH Dennis Cote

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-03-03 Thread Dennis Cote
Thufir wrote: > > But isn't recursion, for better or worse, part of the SQL:2003 standard? > It's an optional part of the SQL:1999 standard that is not widely implemented. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread Dennis Cote
; - " || Surname AS Nominative FROM Students HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Update fail without ERRORS

2008-02-29 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > > How can I debug this issu ? > You will have to show some of the code you are having problems with before anyone here can help you with this. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite

Re: [sqlite] Optimization Question for SQLite Experts

2008-02-29 Thread Dennis Cote
leaves_index on LEAVES (leafID)", > 0, 0, ); > > > > the OPEN worked fine, so why is CREATE INDEX returning this error ? > - > I suspect the error is due to the fact the index already exists. It only needs to be created once,

Re: [sqlite] newB question; c++ and sqlite3; how2 check if word exist in the table

2008-02-29 Thread Dennis Cote
ry will work: select exists (select * from words where word = :word); HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Optimizing an insert/update

2008-02-29 Thread Dennis Cote
rning+c%2b%2b+sqlite3 This exact issue was discussed. You can prepare the query once, and execute it 50K times in a transaction to quickly enter all your words. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Join Syntax Questions

2008-02-29 Thread Dennis Cote
RDER BY im.balance_due DESC, im.invoice_date, im.total DESC, im.customer_name Where you can easily see that the only columns you are selecting are the from the im table (invoice_master). The columns from the the_

Re: [sqlite] export to SQL insert statements with column names

2008-02-29 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > Is there a way to export/dump SQLite data into INSERT statements which > also have column names? > No. You would have to build a custom version and modify the source of the dump command in shell.c. HTH De

Re: [sqlite] Question on Blobs

2008-02-29 Thread Dennis Cote
bzip, should work fine. Note the encoding scheme must not split a file into multiple lines (i.e the encoded format can't have any embedded linefeeds), since the .import command would split the file into multiple records. HTH Dennis Cote ___ sqlit

Re: [sqlite] undefined symbol: sqlite3_prepare_v2

2008-02-29 Thread Dennis Cote
o execute the query. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question on Blobs

2008-02-28 Thread Dennis Cote
to use in that you need to make more function calls to insert the blob, but they allow the application to use less memory, and they can handle data that is larger than what will fit in memory (i.e. it is the only way to insert a 100G file on a machine with only 2G of memory). HTH Denni

Re: [sqlite] Keeping ROWID for INSERT OR REPLACE

2008-02-28 Thread Dennis Cote
the index on mytable, since it can get the required rowid value directly from the index. Also, since you already have the rowid for the row in the update case, the update will not need to reference the index to locate the row, it will go directly t

Re: [sqlite] Problems with Floating Point

2008-02-26 Thread Dennis Cote
M+floating+point=gmane.comp.db.sqlite.general It seems ARM has some unusual handling of endianness that may be causing your problems. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Reducing size of timestamps

2008-02-22 Thread Dennis Cote
These values are harder to use, but can save considerable space and work quite well if you have lots of data stored at fairly regular intervals. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Dennis Cote
materials processing. I'm not sure how useful it would be for XML unless you were trying to store a parse tree of an XML document in your database. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Dennis Cote
Samuel Neff wrote: > As I understand it, recursion in SQL > is referring to self-referencing tables that create a parent/child > relationship. Actually the WITH RECURSIVE clause in SQL:1999 handles multiple mutually recursive tables as well as self referential tables. De

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Dennis Cote
this. It uses a WITH RECURSIVE clause as a prefix to a SELECT. It hasn't been widely implemented, but I believe that IBM's DB2 supports this mechanism. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/

Re: [sqlite] Hierarchical Deletion via a Trigger?

2008-02-22 Thread Dennis Cote
; If not, does anyone have any brilliant ideas? > See http://article.gmane.org/gmane.comp.db.sqlite.general/17286/match=managing+trees+database for a method I use to manage trees in SQLite that works very well. HTH Dennis Cote ___ sqlite-users mailing

Re: [sqlite] trying to locate older version of SQLite

2008-02-22 Thread Dennis Cote
ine shell program (and probably all other files as well). HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Dennis Cote
t is already the most widely deployed database (unqualified), and I think it is almost certain that it will become the most widely deployed database at some some point in time (if it isn't already). That said, I agree with Toby that you must be careful about your assumptions and arguments

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Dennis Cote
ll I know, but if it is not, then it substantially increases the number of non-SQLite database deployments. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Checking that a row exists?

2008-02-21 Thread Dennis Cote
Fin Springs wrote: > > I have been using: > > SELECT NULL FROM sqlite_master WHERE type='table' AND lower(name)=? > > to determine whether a table exists and looking at the number of rows > returned (I'm using sqlite3_get_table through an API). I get one row > back if the table exists and no

Re: [sqlite] Checking that a row exists?

2008-02-21 Thread Dennis Cote
existence check. This query returns a boolean result and stops as soon as it has determined the result select exists (select * from contacts where contacts_phone_tel glob ?); HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-21 Thread Dennis Cote
t then simply replace that identifier with a literal string containing the word to be inserted. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to Optimize query

2008-02-21 Thread Dennis Cote
NTEGER, > [server_start_time] INTEGER, > [server_uptime] INTEGER, > [server_uptime_diff] INTEGER, > [server_is_connected] INTEGER) > It would help to add an index on server_timestamp in the timestamp_master table. create index server_timestamp_idx on timestamp_master(server_timestamp);

Re: [sqlite] Limit number of records to search in a table in SQlite

2008-02-20 Thread Dennis Cote
Kalyani Phadke wrote: > > Any suggestions? > Please stop hijacking message threads. http://en.wikipedia.org/wiki/Thread_hijacking Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-19 Thread Dennis Cote
e row with a new one that has the count incremented if the word already exists. It will insert the word with a count of 1 if not. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Selecting last item in a unique index

2008-02-15 Thread Dennis Cote
s. Always assume your table is scrambled to an arbitrary row order before each query since SQL works with sets of rows, not ordered tables like a spreadsheet. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Selecting last item in a unique index

2008-02-15 Thread Dennis Cote
Ken wrote: > select * from foo > where rowid = > (select rowid from foo > where parent_id = 1 > and child_id = 2 > group by parent_id, child_id > having revision = max(revision)) > > sqlite> explain query plan >...> select * from foo >...> where

Re: [sqlite] Selecting last item in a unique index

2008-02-15 Thread Dennis Cote
ueries are sub-optimal? They will both use the index to find the correct revision number, and then use the index to find the matching row. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Optimizing Query

2008-02-14 Thread Dennis Cote
matched field b or field c in table1, and the sum of all the field a values from table1 where the row's id matched field b or field c. Note the values in the first row are not valid because that row gets overwritten on each replacement. If this is correct, it seems to me there should be a

Re: [sqlite] SQL error: unrecognized token: "#"

2008-02-14 Thread Dennis Cote
Try "user#" instead of user# and you will be set. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] View update performance (was: Updatable views)

2008-02-14 Thread Dennis Cote
> I have not updated the patch, however. It *should* be pretty > straightforward -- looking at it again, it doesn't actually seem to do > any VDBE code itself, so who knows? > Stephen, FYI, your ticket was fixed on Tuesday by checkin 4782 in case

Re: [sqlite] tclsqlite3

2008-02-12 Thread Dennis Cote
many possible causes. Since others are able to run this library, it is most likely something specific to your machine. You might want to run a memory test such as http://www.memtest.org/ to rule out hardware issues. After that start going through some of those links

Re: [sqlite] View update performance (was: Updatable views)

2008-02-12 Thread Dennis Cote
usy and just skim the postings. :-) I'm glad you didn't give up on your idea. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Updatable views

2008-02-12 Thread Dennis Cote
databases created in SQLite using standard quoting would be more easily portable to any of these other databases if the need arises. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Updatable views

2008-02-12 Thread Dennis Cote
pparent huge overhead of > the inefficiency that Steve raised about using updatable views ;-) > Likewise, I think this is a very good optimization idea that should be implemented as soon as possible. I see he has created a ticket to get it on the radar

Re: [sqlite] Updatable views

2008-02-11 Thread Dennis Cote
N) searches in the index to find the row to delete or update, and only need to do a very fast isnull check on that one row. Because all three cases use the same index, all the pages needed should be in the page cache after the first scan, so they should not require any additional I/O, and he

Re: [sqlite] Updatable views

2008-02-11 Thread Dennis Cote
y to change? It seems a > common need. > Tom, Standard SQL doesn't allow any SQL-Schema statements (basically any create or drop statements) in a trigger body. I doubt this will ever change. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@s

Re: [sqlite] Updatable views

2008-02-11 Thread Dennis Cote
bility of course. This would allow users to use only the SQL standard quoting rules, and still get proper error messages if they make a typographical error. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Updatable views

2008-02-11 Thread Dennis Cote
atch itself will probably have to be modified, since SQLite recently underwent significant changes to its code generation routines. As with all patches, it will be reviewed and accepted much faster if it passes the test suite. HTH Dennis Cote ___ sqlite-us

Re: [sqlite] Join trouble

2008-02-11 Thread Dennis Cote
on is only available in versions of SQLite since 3.5.5. Note the trim() function has been around for a long time. It will trim both trailing and leading spaces. If you don't need to preserve leading spaces, then it should be sufficient to clean up your data. You can check your version with a simp

Re: [sqlite] Updatable views

2008-02-11 Thread Dennis Cote
select id from "New Id" where "table name" = 'Orders Refunds' ) , ( select ID from Paying where Label = new.Paying ) where new.Paying not null ; insert into [Orders Refunds Amount] (

Re: [sqlite] INSERTing records in two tables?

2008-02-11 Thread Dennis Cote
If you do that you need to ensure the customer name values are unique. insert into phones (tel, id_customer) values ('1234567', (select id from customer where name = 'John Doe')); insert into phones (tel, id_customer) values ('9876543', (select id from customer where name = 'John Doe

Re: [sqlite] custom sql functions

2008-02-08 Thread Dennis Cote
n aggregate functions. It will be no faster than what you have now. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] VFS memory leak : During lock / unlock operations

2008-02-08 Thread Dennis Cote
less on windows > and unix. > Richard, The OP said they were measuring an excess of lock calls. That would imply that SQLite is locking files it has already locked. Is that possible with the POSIX APIs? Dennis Cote ___ sqlite-users mailing list sq

Re: [sqlite] Version 3.2.2

2008-02-08 Thread Dennis Cote
omewhere along the line. Aren't standards wonderful, especially when everyone has their own. :-) HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] [3.5.4] Fails importing CSV file

2008-02-04 Thread Dennis Cote
insert into customer select null, tel, name from temp_customer; drop table temp_customer; HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Number of columns in table

2008-01-31 Thread Dennis Cote
names and field data for each result row, and then calls the callback function. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Proper SQL Syntax for a SELECT with LEFT JOIN Syntax for a 1 Primary Table, N Secondary Tables

2008-01-31 Thread Dennis Cote
sqlite> CREATE VIEW UserView3 AS ...> SELECT UserNumber, UserType, UserName, UserStatus, Password, PasswordHint ...> FROM UserTable ...> LEFT JOIN UserTypeTable using(UserTypeKey) ...> LEFT JOIN UserStatusTable using(UserStatusKey); SQL error: cannot join using colum

Re: [sqlite] Number of columns in table

2008-01-30 Thread Dennis Cote
The argv array contains pointers to the string representation of each filed in the row, there is one string for each of the argc fields. If a field is null then its string pointer (in argv) will be NULL). HTH Dennis Cote - To

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