Re: [sqlite] Counting rows

2014-12-11 Thread Adam Devita
>From previous reading (years ago on this list) I normally do select count(1) from tableName ; to count the rows in a table. as an alternate, select count(primary_key_or_SomeIndexName) from tableName when trying to get an actual count. beware: select count(someField) from table; will not count

Re: [sqlite] Best Practice: Storing Dates

2015-01-14 Thread Adam Devita
, have the authority to change the time zone or implementation date for their population, there is a high potential for change. 3rd party time zone rule libraries can externalize most of the maintenance work without affecting the core app or the database. regards, Adam DeVita On Wed, Jan 14, 2015

[sqlite] building SQLite DLL with Visual C++

2015-04-22 Thread Adam Devita
) ? If you insist on creating your own dll, try the vs wizard to create a dll project, then add code to it. regards, Adam DeVita On Wed, Apr 22, 2015 at 9:51 AM, Igor Tandetnik wrote: > On 4/21/2015 11:01 AM, Jay Smith wrote: >> >> Before I sent the last message I had signed up to becom

[sqlite] building SQLite DLL with Visual C++

2015-04-23 Thread Adam Devita
e to store data. I studied SQL and Oracle 10 > years ago. I have almost completed the database for the project. My > problem is how to integrate the SQL db into my VB program. > > On Wed, Apr 22, 2015 at 10:16 AM, Adam Devita wrote: > >> Good day, >> >> >>

[sqlite] what is typical pattern for test double of sqlite c api

2015-08-11 Thread Adam Devita
Good day, I'm about to implement TDD for an existing c project that uses sqlite, using CPPUnit. Sqlite would be a dependency from the point of view of the routines making calls to it. Is is typical to just write a link time stub to substitute commonly used parts of the interface (exec, open,

[sqlite] setup C code with cppunit using test db

2015-08-11 Thread Adam Devita
into this one? What should I do ? regards, Adam DeVita -- -- VerifEye Technologies Inc. 151 Whitehall Dr. Unit 2 Markham, ON L3R 9T1

[sqlite] Making data unique

2015-12-07 Thread Adam Devita
When you are about to insert into the table and find that ID & Date/time are identical to another record, but the data is different, do you want to overwrite, or not? Do you want an error? Adam On Mon, Dec 7, 2015 at 10:01 AM, Andrew Stewart wrote: > Hi, > I have a table that

[sqlite] How to see SQLite debugging information

2015-12-09 Thread Adam Devita
or potential source of error in a chain. regards, Adam DeVita On Wed, Dec 9, 2015 at 10:12 AM, Bart Smissaert wrote: > Will look at this, it is a VB6 console app and that may just do the job: > http://vb.mvps.org/samples/Console/ > > RBS > > On Wed, Dec 9, 2015 at 1:03 PM, wrote:

[sqlite] Problem with accumulating decimal values

2015-12-11 Thread Adam Devita
A good start at the long answer can be found in the archives of this list. http://sqlite.1065341.n5.nabble.com/Simple-Math-Question-td85140.html#a85157 also found at https://www.mail-archive.com/sqlite-users at mailinglists.sqlite.org/msg04587.html (web search sqlite "simple math question") It

[sqlite] Problem with accumulating decimal values

2015-12-16 Thread Adam Devita
Good day, As a matter of interest, when calculating interest on a sum of money expressed in pennies, how do you handle int arithmetic truncating? Is that an accounting design rule thing when dealing with fractions of a penny to round? Is this an arbitrary quantization? Once upon a time there

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Adam Devita
Good day, I'm sure others on the list will add better insight, but is your task parallel enough that your nodes can work with a copy of the database and submit changes the one the others copy from when 'done' their calculation? Are you using https://www.sqlite.org/c3ref/busy_timeout.html ?

[sqlite] CSV excel import

2015-07-30 Thread Adam Devita
Instead of trying to conform to MS-Excel's csv format, wouldn't it be better to write an import from .xls (or .ods if that is an open standard) directly? That way each cell's value can be bound to a position holder in a query. No more fussing with "In this country we use this symbol to denote

[sqlite] FW: SQLite (1.0.97) access via LAN

2015-06-26 Thread Adam Devita
What happens if you map a network drive to \\PC-Name\C\FolderName (say drive X:) and then try to open the file as x:\data.db ? Adam On Thu, Jun 25, 2015 at 10:24 AM, Takashi Fukuda wrote: > Donald Griggs tried to help this problem, and we looked at the Jean C's > advice. However the problem

[sqlite] minor doc error

2015-03-09 Thread Adam Devita
https://www.sqlite.org/tempfiles.html "On of the distinctive features of SQLite" should be "One of the distinctive features of SQLite"

[sqlite] (no subject)

2015-03-11 Thread Adam Devita
from http://sourceforge.net/projects/sqlitemanager/ "SQLiteManager is a multilingual web based tool to manage SQLite database. The programming language used is: PHP4, but work fine with PHP5. Work just as well on a platform Linux as on Windows or MAC." from http://www.sqlite.org/ "SQLite is a

[sqlite] Why is empty string not equal to empty blob?

2015-03-19 Thread Adam Devita
As a general rule of thumb, if things are different type, they can't be equal. One already knows the column type. To compare apples to apples, one would cast to convert them. sqlite> SELECT '' = x''; 0 sqlite> SELECT cast('' as blob) = x''; 1 Perhaps some confusion comes from how numbers are

[sqlite] possible bug 3.8.1 /3.8.3

2014-02-03 Thread Adam Devita
ULL, data_blob BLOB NOT NULL); sqlite> SELECT id, data_blob FROM data WHERE stream_num = 2 order by timestamp asc LIMIT 1; 4|☺ sqlite> SELECT id, data_blob FROM data WHERE timestamp = (SELECT MIN(timestamp) FROM data WHERE stream_num = 2) LIMIT 1; 3|☻ sqlite> regards,

Re: [sqlite] possible bug 3.8.1 /3.8.3

2014-02-03 Thread Adam Devita
is picked. regards, Adam On Mon, Feb 3, 2014 at 12:47 PM, Richard Hipp <d...@sqlite.org> wrote: > Can you provide data? Without some sample data, we cannot tell if the > answer SQLite is providing is right or wrong. > > > On Mon, Feb 3, 2014 at 12:25 PM, Adam Devita <adev..

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-10 Thread Adam Devita
Good day, I'd rather the warning be in the text when you open the sqlite tool with an implied in memory database. Put an extra \n if you want the warning to stand out. Adam On Mon, Feb 10, 2014 at 1:26 PM, Petite Abeille wrote: > > On Feb 10, 2014, at 5:19 PM,

Re: [sqlite] How to use SQLite in C#

2014-02-13 Thread Adam Devita
ols. regards, Adam DeVita On Wed, Feb 12, 2014 at 9:23 AM, Jamiil <jam...@live.ca> wrote: > After downloading sqlite-netFx451-static-binary-x64-2013-1.0.90.0 and > uncompressing it, I got this list of file: > > Installer.exe > Installer.pdb > northwind

Re: [sqlite] Recommended way to delete rows

2014-02-28 Thread Adam Devita
Yes. On Fri, Feb 28, 2014 at 12:18 PM, L. Wood wrote: > > I expect #2 to work best. Make sure to enclose the whole thing in an > > explicit transaction (or at least, run large batches within explicit > > transactions; one implicit transaction per deleted row will be slow as >

Re: [sqlite] SQLite destroys civilization.

2014-03-03 Thread Adam Devita
LOL! Hopefully they wrote credit at the top of the source file. I saw season 1 of the show. Aaron is a "good guy". http://en.wikipedia.org/wiki/Revolution_%28TV_series%29 A On Sun, Mar 2, 2014 at 9:40 PM, mm.w <0xcafef...@gmail.com> wrote: > LOL > > don't know if it will go thru see png > >

Re: [sqlite] How synchronize two databases

2014-03-10 Thread Adam Devita
. regards, Adam DeVita On Mon, Mar 10, 2014 at 8:15 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 10 Mar 2014, at 12:58pm, Muhammad Bashir Al-Noimi <mbno...@gmail.com> > wrote: > > > May I get some help from you guys? > > If you're asking how to syn

Re: [sqlite] SQLite Support for CE x32 FW 3.5

2014-08-06 Thread Adam Devita
Did you already read https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki#sqlite-netFx35-binary-PocketPC-ARM-2008 ? On Tue, Aug 5, 2014 at 10:32 AM, Tobias Stüker wrote: > Hello, > > I am developing an .NET Framework 3.5 application for a Windows CE

Re: [sqlite] Crash in sqlite3_mutex_try [Was: SQLite 3.8.6 beta]

2014-08-12 Thread Adam Devita
1a) Somebody is paying you to do it. 1b) Incremental cost (or risk) of supporting it is small compared to the cost (or risk) of porting /upgrading Adam On Tue, Aug 12, 2014 at 2:46 AM, Klaas V wrote: > > > Jan wrote: " ** can manually set this value to 1 to emulate

Re: [sqlite] Window functions?

2014-08-28 Thread Adam Devita
likely to change without notice. Thanks for the references about windowing functions. Very interesting. The point of what is heavy now vs in 2020 is well made. Is Windowing a Major endeavor, better for sqlite 4? Adam DeVita On Wed, Aug 27, 2014 at 8:25 PM, Keith Medcalf <kmedc...@dessus.com>

Re: [sqlite] DEFAULT expression ignored for INTEGER PRIMARY KEYs?

2014-09-25 Thread Adam Devita
Your table definition seems to have a contradiction. The expression INTEGER PRIMARY KEY is a special keyword that means 'auto-increment', which would be a default value. DEFAULT (random() ) would contradict the auto-increment instruction. The row id was being used to generate the key. On Thu,

Re: [sqlite] X most recent entries

2011-03-14 Thread Adam DeVita
select id from table order by id desc limit 5000 Adam On Mon, Mar 14, 2011 at 1:52 PM, Ian Hardingham wrote: > Hey guys. > > I have a table with an autoincrement primary ID, and as part of a select > I would like to only take the 5000 "largest"/most recent ids. Is there > a

Re: [sqlite] X most recent entries

2011-03-14 Thread Adam DeVita
ELECT rowid FROM > multiturnTable WHERE player1 ='?' UNION ALL SELECT rowid FROM > multiturnTable WHERE player2 = '?') AND (complete=0 OR p1SubmitScore=0 > OR p2SubmitScore=0) > > And I only want to consider the last 5000 for any SELECTs from > multiturnTable. > > Thanks, >

[sqlite] What happens if you insert more than your RAM size into an in memory database?

2011-04-18 Thread Adam DeVita
Good day, What happens if you insert more than your RAM size into an in memory database? (I'm particularly interested in the Windows context). regards, Adam ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] What happens if you insert more than your RAM size into an in memory database?

2011-04-19 Thread Adam DeVita
; > > eLaReF > > > > > On 18/04/2011 14:46, Pavel Ivanov wrote: > > You won't be able to insert. The statement will fail. > > > > Pavel > > > > > > On Mon, Apr 18, 2011 at 9:44 AM, Adam DeVita<adev...@verifeye.com> > wrote: >

Re: [sqlite] SQLite as a Logger: How to mimic "rotation of logs"?

2011-05-10 Thread Adam DeVita
Why not use INSERT OR REPLACE to your advantage? If you set the maximum number of log entries you wanted to keep, then kept track of your log insert statement, you could wrap by int this_log_entry_id=1; //initialize.. actually could be initialized by getting the log entry id of the min date in

[sqlite] Auto index with wrong number of entries

2011-06-28 Thread Adam DeVita
from ... table above. I can see the data that I want to export. How do I fix these indexes? regards, Adam DeVita ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Auto index with wrong number of entries

2011-06-29 Thread Adam DeVita
Success! On Tue, Jun 28, 2011 at 11:34 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 28 Jun 2011, at 4:22pm, Adam DeVita wrote: > > > I can see the data that I want to export. How do I fix these indexes? > > Use the sqlite3 command-line shell to dump t

Re: [sqlite] Auto index with wrong number of entries

2011-06-29 Thread Adam DeVita
; > On 29 Jun 2011, at 2:04pm, Adam DeVita wrote: > > > On Tue, Jun 28, 2011 at 11:34 AM, Simon Slavin <slav...@bigfraud.org> > wrote: > > > >> Use the sqlite3 command-line shell to dump the database to SQL commands, > >> then create a new database by read

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Adam Devita
I think the OP meant to write: "If the expression is an aggregate expression, it is evaluated across all rows in the group. Otherwise, it is evaluated against a single arbitrarily chosen row from within the group. " Is there a way I could programmatically determine that a query is going to use an

[sqlite] Mailing list policy change

2015-10-29 Thread Adam Devita
Assuming the A*spammer is a basic algo subscribed to the list, and sending to any sender in a reasonably short time after posting; Question: Is it possible for the admin to easily backup the list, bisect it, and test for spam? That technique should identify the offending address in

[sqlite] Primary key values can be NULL

2016-04-18 Thread Adam Devita
I had a similar thought, until I imagined Program uses sqlite DLL The program creates dbs, and sometimes does inserts with null primary keys. (Why is beyond the scope, it just does sometimes.) Upgrading the DLL would start making files in the new format, but the program using the dll doesn't

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Adam Devita
of memory it used as dropped? (This is obvious for high security mode, but otherwise?) regards, Adam DeVita On Fri, Apr 22, 2016 at 8:23 AM, Cecil Westerhof wrote: > 2016-04-22 14:06 GMT+02:00 E.Pasma : > >> >> 22 apr 2016, Cecil Westerhof: >> >>> >>>

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-02-01 Thread Adam Devita
At the risk of repeating something mentioned last week on this thread. One tactic to reduce/avoid the no-directory sync problem is to use WAL mode. The commit in WAL is write to the WAL file, so the the directory sync problem goes away. If you want to be in paranoid mode, don't trust others. Why

[sqlite] How to enter Unicode character?

2016-02-08 Thread Adam Devita
Good day, What OS are you using? Have you read up on this? http://www.fileformat.info/tip/microsoft/enter_unicode.htm Also, Notepad++ is a good text editor for displaying / saving them. (I assume that you are wanting to generate some text files as scripts) regards, Adam DeVita On Mon, Feb 8

[sqlite] analysis of a corrupt db

2016-01-12 Thread Adam Devita
e upgrade, or immediately after it as the normal mode works through the records with 'dirty' cache. That said, all ~200 records of 'dirty' cache should be updated in 1 transaction, so 1 record being wrong seems to not fit. ) regards, Adam DeVita BTW: While testing this, I noticed that if I ftp

[sqlite] analysis of a corrupt db

2016-01-12 Thread Adam Devita
ur device doesn't have all the utilities but I can put a copy of the bad db on a development linux environment for further tests. On Tue, Jan 12, 2016 at 10:55 AM, Richard Hipp wrote: > On 1/12/16, Adam Devita wrote: >> >> Shell Tool Observations: >> SQLite version 3.8.4.3 201

[sqlite] analysis of a corrupt db

2016-01-12 Thread Adam Devita
# of entries in index sqlite_autoindex_config_1 regards, Adam On Tue, Jan 12, 2016 at 12:01 PM, Adam Devita wrote: > Good day, > Thank you for some avenues of investigation. > > Q: Does your program examine the codes returned by SQLite3 calls and > check to see that they

[sqlite] analysis of a corrupt db

2016-01-14 Thread Adam Devita
be run under sub-optimal power conditions. It seems unlikely this is an sqlite issue. It may be a file system / hardware / harsh environment thing. Adam On Wed, Jan 13, 2016 at 7:00 PM, David Woodhouse wrote: > On Tue, 2016-01-12 at 12:18 -0500, Adam Devita wrote: >> >> A co-worker

[sqlite] Using sqlite3.exe as a subprocess

2016-01-15 Thread Adam Devita
an redirect your output to another file and funnel everything through .read Be careful about empty set results! regards, Adam DeVita On Fri, Jan 15, 2016 at 8:32 AM, Dominique Devienne wrote: > On Fri, Jan 15, 2016 at 4:53 AM, Matthew Allen wrote: > >> It seems that sqlite3.exe (console)

[sqlite] SQLite crashing

2016-01-25 Thread Adam Devita
Where do you pass to the dll something that goes to sqlite3_close(db); ? ( https://www.sqlite.org/c3ref/close.html ) When that happens, does m_db get set to NULL (or now refers to memory that is now NULL) Do you check for m_db == NULL before deleting it? regards, Adam DeVita On Mon, Jan 25, 2016

[sqlite] SQLite crashing

2016-01-25 Thread Adam Devita
een null at this point" Are you unit testing the trivial cases? Create+Destroy Create+Connect+Destroy Create+Connect+DoBasicQuery+Destroy regards, Adam On Mon, Jan 25, 2016 at 2:02 PM, Igor Korot wrote: > Hi, Adam, > > On Mon, Jan 25, 2016 at 11:27 AM, Adam Devita wrote: >>

[sqlite] SQLite Pronunciation

2016-03-16 Thread Adam Devita
Since Jay is The Certified SQLite Professional , ( https://www.mail-archive.com/sqlite-users at mailinglists.sqlite.org/msg04840.html ) and by fortunate co-incidence what he said (and DRH) happens to match what I was doing, I'll agree with them, and celebrate by making a potato salad with

[sqlite] Article about pointer abuse in SQLite

2016-03-22 Thread Adam Devita
variant of "hay, you are depending on implemented, not documented behaviour" ? regards, Adam DeVita On Tue, Mar 22, 2016 at 7:27 AM, Scott Doctor wrote: > > It is uninitialized. you are setting an initial value within an if > statement. For the compiler, the code has NOT ac

[sqlite] strftime accepts an illegal time string

2016-05-05 Thread Adam Devita
ling it out so save a few KB on the device.) People on the list are genuinely trying to be helpful, even if cross language text comes across as terse, try to keep that context. best wishes, Adam DeVita On Thu, May 5, 2016 at 8:52 AM, Cecil Westerhof wrote: > 2016-05-05 12:39 GMT+0

[sqlite] Fastest way to backup/copy database?

2016-05-05 Thread Adam Devita
the remote host decided to change their address or pc and the sync fails because it is asking if THIS host can be trusted. regards, Adam DeVita On Thu, May 5, 2016 at 11:50 AM, Rob Willett wrote: > Hi, > > We did look at this before, and discarded the idea but I can?t remember >

[sqlite] Fastest way to backup/copy database?

2016-05-09 Thread Adam Devita
Re WAL mode trick. I think you would want to complete a checkpoint and then do the backup, ensuring that no check-points are done during your backup time. This way, you know that your committed transactions prior to the backup are in the file being backed up. regards, Adam On Sat, May 7, 2016

[sqlite] Podcast with Dr Hipp: SQLite history, success and funding

2016-05-19 Thread Adam Devita
This link is a presentation on 'we wish git had this' https://www.youtube.com/watch?v=ghtpJnrdgbo by DRH. This is the fossil page on the subject of comparing vs git. http://www.fossil-scm.org/xfer/doc/trunk/www/fossil-v-git.wiki That said, at my workplace we use git. How else can Windows

Re: [sqlite] copy data from one db to another

2010-06-08 Thread Adam DeVita
start by doing an open db1 (as main) then attach path to db2 as 'db2' insert into main.table_one_name select * from db2.table_one_name ; This selects all records from db2 and puts them into db1 in one statement. Adam On Tue, Jun 8, 2010 at 3:02 PM, Scott Frankel wrote:

Re: [sqlite] copy data from one db to another

2010-06-08 Thread Adam DeVita
:09 PM, Scott Frankel <fran...@circlesfx.com> wrote: > > On Jun 8, 2010, at 12:07 PM, Adam DeVita wrote: > > > start by doing an open db1 (as main) > > then attach path to db2 as 'db2' > > > > insert into main.table_one_name select * from db2.table_one_name ; &g

Re: [sqlite] database development - correct way?

2010-06-09 Thread Adam DeVita
I wouldn't advise using an SQL keyword as a table name: "Order" I presume that your order collection table example is shorter than the real one for the sake of the example? One often sees a date or time of some sort associated with an order so that one can create reports based on dates. (How

Re: [sqlite] Mail loop?

2010-06-14 Thread Adam DeVita
Is it possible for the list admin to seed a message to the list that, if auto-replied, would automatically remove one from the list? This thread, although off the sqlite topic, is still interesting. regards, Adam On Mon, Jun 14, 2010 at 10:06 AM, Black, Michael (IS) < michael.bla...@ngc.com>

Re: [sqlite] concat 2 const chars ?

2010-07-09 Thread Adam DeVita
>From the point of view of a C question, make your array of characters large enough to hold the characters you want (and terminating null) before copying them in. >From the point of view of an SQL: if you want to change the comparison constant in a where clause, look up bind parameters. read

Re: [sqlite] concat 2 const chars ?

2010-07-09 Thread Adam DeVita
and don't use strcpy here is why https://buildsecurityin.us-cert.gov/bsi-rules/home/g1/848-BSI.html On Fri, Jul 9, 2010 at 3:06 PM, rollerueckwaerts wrote: > > Hello, > I try to get an sql query string from 2 const chars. > > const char *language; > language = "'6'"; >

Re: [sqlite] Substring (LIKE "%key%") searches, would FTS3 with suffix-tree tokenizer be the fast way?

2010-08-06 Thread Adam DeVita
A variant on Simon's plan. Are the 10,000 rows static, slowly changing, or frequently changing? Does it make sense to pre-calculate some counts at the time data is loaded? Is this memory constrained so much that you can't afford 1 or 2 MB to let you look up based on ints? (I'm assuming that one

Re: [sqlite] Is there a table that show all the available function from sqlite3?

2010-08-13 Thread Adam DeVita
Are you looking for http://www.sqlite.org/c3ref/funclist.html ? On Fri, Aug 13, 2010 at 12:37 PM, Peng Yu wrote: > Hi, > > http://www.sqlite.org/docs.html > > I don't see a table that shows all the available functions in sqlite3. > Would you please let me know if there is

Re: [sqlite] Tricky grouping query

2010-10-01 Thread Adam DeVita
Why would you want to do this in plane sql, as opposed to using the API to go through the list and derive it? On Fri, Oct 1, 2010 at 3:37 PM, Andy Chambers wrote: > Given the following > > create table events ( > id, > date, > status > ); > insert into events

Re: [sqlite] 64 bit sqlite 3

2010-12-17 Thread Adam DeVita
Will a 64 bit Windows DLL eventually be posted for download? On Fri, Dec 17, 2010 at 9:45 AM, Eric Smith wrote: > On Fri, Dec 17, 2010 at 4:36 AM, giuseppe500 wrote: > > There is a version of SQLite 3 for 64-bit systems? > > or, you can simply compile

Re: [sqlite] 64 bit sqlite 3

2010-12-22 Thread Adam DeVita
cially released code. Now, after showing that my 64 bit problems go away when I include the amalgamation source in the project, the whining just stops. thanks :) Adam On Fri, Dec 17, 2010 at 5:20 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 17 Dec 2010, at 4:30pm, Adam DeVita wr

Re: [sqlite] R: R: Crypto lib for Sqlite - suggest required

2011-01-10 Thread Adam DeVita
Just to add my $0.02 We use http://www.safenet-inc.com/ HASP HL Encryption. (We use HASP keys for end user products so it was 'free' to my internal product tracking system db.) This key allows the exe to get encrypted and optionally a data file as well. The encryption of the program provides us

Re: [sqlite] Propose minor incompatible API change

2011-01-11 Thread Adam DeVita
I think that a bunch of good points have been made, especially as to why you should hold your ground. (I don't have sympathy for poor code that doesn't follow the documentation, especially when there is a large, competent, and helpful community group that usually comes to people's aid in less

[sqlite] Foreign key support

2009-01-30 Thread Adam DeVita
Good day, If I write into the sqlite3 using the analyzer: create table mysns (SN int primary key, desc text); insert into mysns (SN, desc) values (1,2); create table t2 (mynum int, desc2 text, SN references mysns(SN) ); insert into t2 (mynum, desc2, SN) values (1,"two", 3); This insert didn't

Re: [sqlite] Trying to INSERT rows into a table

2009-02-06 Thread Adam DeVita
Why are you calling reset after step? regards, Adam On Fri, Feb 6, 2009 at 3:51 PM, Stephen Abbamonte wrote: > Hi all I am using SQLite3 and running into a bit of a snag. I have a > Database with an empty table and I am calling a series of INSERT commands > during the

Re: [sqlite] Trying to INSERT rows into a table

2009-02-06 Thread Adam DeVita
hed executing successfully. > sqlite3_step() should not be called again on this virtual machine without > first calling sqlite3_reset() to reset the virtual machine back to its > initial state." > > > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto

Re: [sqlite] Merging two SQLites + leaving out duplicates?

2009-03-13 Thread Adam DeVita
ted back to the case of just updating db1 with new or newer records in db2. regards, Adam DeVita On Fri, Mar 13, 2009 at 11:24 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > "Gilles Ganault" <gilles.gana...@free.fr> wrote in > message news:bcqkr45c944gv4g1h9ovpjq1o

Re: [sqlite] Database inserts gradually slowing down

2009-06-16 Thread Adam DeVita
Remember the implications of Moore's law and how much time has passed. CPU speed is much faster than memory speed. Memory speed is much faster than disk access. This is why hardware folks play all sorts of tricks with pipelines, caches, interleaving, and parallelism. For a single process that

Re: [sqlite] listing tables in a database

2009-06-18 Thread Adam DeVita
SELECT name, sql FROM sqlite_master WHERE type='table' On Thu, Jun 18, 2009 at 12:47 PM, Gary Johnson wrote: > I'm looking for a way to programmatically get a list of all tables in > an SQLite database -- effectively emulating the .tables command but > using the C API

Re: [sqlite] search in archive

2009-06-19 Thread Adam DeVita
There is a search of archives at http://www.mail-archive.com/sqlite-users%40sqlite.org/ On Fri, Jun 19, 2009 at 2:43 PM, Kees Nuyt wrote: > On Fri, 19 Jun 2009 13:56:52 -0400, "Rizzuto, Raymond" > wrote: > > > Is it possible to have a search feature

Re: [sqlite] search in archive

2009-06-19 Thread Adam DeVita
The link I posted (http://www.mail-archive.com/sqlite-users%40sqlite.org/) only goes back to March 10, 2009 It searches well but is currently incomplete. Will it be expanded to include older posts? http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/ goes back much further, but

Re: [sqlite] Nested Inner Join Help

2009-07-02 Thread Adam DeVita
why not use: SELECT A.ID , A.Column1, A.Column2, B.Column1, C.Column1 FROM A INNER JOIN B ON A.Column3 = B.ID INNER JOIN C ON B.Column2 = C.ID ? On Thu, Jul 2, 2009 at 2:53 PM, Ed Hawke < edward.ha...@hawkeyeinnovations.co.uk> wrote: > Hi all, > >

[sqlite] Optimizing insert or replace speed

2009-07-14 Thread Adam DeVita
Good day, Could someone explain where I'm going wrong with this? I've identified the following query as a bottle neck in a utility I've written. insert or replace into main.masterlist select * from delta.masterlist d where d.write_out_ok=0 and d.sn not in(select M.sn from main.masterlist M

Re: [sqlite] Optimizing insert or replace speed

2009-07-14 Thread Adam DeVita
e into main.masterlist > select d.* > from delta.masterlist d left outer join main.masterlist M on d.sn = > M.sn >where d.write_out_ok=0 > and d.record_updatetime >= ifnull(M.record_updatetime, '') > > > Pavel > > On Tue, Jul 14, 2009 at 12:54 PM

Re: [sqlite] Optimizing insert or replace speed

2009-07-15 Thread Adam DeVita
tetime > d.record_updatetime) On Wed, Jul 15, 2009 at 7:33 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > Adam DeVita wrote: > > I've identified the following query as a bottle neck in a utility I've > > written. > > > > insert or replace into main.masterlist

Re: [sqlite] Protect against SQL injection inside of the database?

2009-07-16 Thread Adam DeVita
http://unixwiz.net/techtips/sql-injection.html is a nice introduction to sql injection attacks. (Learning by example) It also explains why binding is far superior to trying to invent a set of rules and cleaning the input. . On Thu, Jul 16, 2009 at 9:01 AM, Michael Schlenker

Re: [sqlite] translating CSV file into sqlite3 database for iPhone?

2009-08-07 Thread Adam DeVita
This is why I generally advocate TAB delimited files over CSV Restaurant , Menu Item, Price Tom, Dick "The MAN", and Harry's Bar & Grill , Specials /new stuff! Mikey's Burger "Delishiousness ' , $5 If you only have to upload your data once, you should be able to use a spreadsheet program to

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Adam DeVita
Good day, Are you looking to simply identify records that are different (not missing from the tables) or identify records with ANY field different and get the result? Is there a primary key? Posting the structure would be helpful. This should not be hard. C:\Documents and

Re: [sqlite] Database Diff libs or applications

2009-10-01 Thread Adam DeVita
There has been a lot of discussion of this and several of us are doing it. Are you talking about A) DB1 which has modify data and DB2 which only receives modifications from DB1 only, or B) DB1 and DB2 both get updates independently and need to be synchronized? or C) something else Not (A or

Re: [sqlite] Synchronising multiple copies of a database

2009-10-07 Thread Adam DeVita
regarding this " The fault is that almost nobody does it right: they neglect to keep an 'unaltered central copy' and think they can cross-apply journals each time two databases talk to one-another. That does not work for various reasons." Would a central repository of journals that can be

Re: [sqlite] Insert speed greatly decreasing over time

2009-10-07 Thread Adam DeVita
Would dropping and re-creating an index help? On Wed, Oct 7, 2009 at 2:19 PM, Alexey Pechnikov wrote: > Hello! > > Try this: > pragma cache_size=20; > > Best regards, Alexey Pechnikov. > http://pechnikov.tel/ > ___ >

Re: [sqlite] Synchronising multiple copies of a database

2009-10-07 Thread Adam DeVita
n, but now there are N entries of the other guy's customer in the database depending on how many times they do it. On Wed, Oct 7, 2009 at 3:18 PM, Simon Slavin <slav...@hearsay.demon.co.uk>wrote: > > On 7 Oct 2009, at 7:20pm, Adam DeVita wrote: > > > regarding this > >

Re: [sqlite] SQLite encription

2009-10-19 Thread Adam DeVita
One can use a 3rd party tool such as a Alladdin HASP key. This encrypts the application, and optionally the database file too. The drivers for the program won't execute a program if it detects a debugger. This solution is of course limited to operating systems with the available drivers. Once

Re: [sqlite] .import on a .csv file

2009-10-22 Thread Adam DeVita
Do you have any new lines, returns, or tabs in any of the real data? Can you prove it? Is this a 1 off thing or are you going to do this routinely? There has been a lot of discussion on this list about importing csv data and the hardships of writing a good csv importer. If this is a one off,

[sqlite] Windows 7?

2009-11-03 Thread Adam DeVita
Good day, Will a new DLL be required for Windows 7 ? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Ideal way to check whether a table has a specific column

2009-11-03 Thread Adam DeVita
Another way SELECT name, sql FROM sqlite_master WHERE type='table' and name ='yourtable name' the field sql will give you the full table structure as a string. Parse for your desired table name. No statements fail. On Tue, Nov 3, 2009 at 4:37 PM, Igor Tandetnik wrote:

Re: [sqlite] Location of Sqlite Files

2009-11-27 Thread Adam DeVita
1) save the db wherever is appropriate for your application. (network drives are generally considered to be a bad idea) 2) An sqllite db is a file. There are lots of ways to delete files Adam On Fri, Nov 27, 2009 at 2:54 PM, mr_orange wrote: > > Hey, I am kind of new to

Re: [sqlite] Archive Search Engine

2009-12-29 Thread Adam DeVita
But there is a search engine on: http://www.mail-archive.com/sqlite-users%40sqlite.org/info.html It is right at the top. Adam On Tue, Dec 29, 2009 at 12:02 PM, Bill Marvin wrote: > > It would be very helpful if there was a search engine for the sqlite-user > mailing

Re: [sqlite] Confusing FAQ(26) wording

2009-12-30 Thread Adam DeVita
http://www.sqlite.org/nulls.html seems to clarify things for me on this topic. Adam On Wed, Dec 30, 2009 at 9:13 AM, Tobias Hoffmann < lsqlite-l...@thax.hardliners.org> wrote: > Hi, > > I had a hard time to understand the FAQ entry on UNIQUE constraint -- in > the end I had to try out sqlite's

Re: [sqlite] Limitation on Column count

2010-01-12 Thread Adam DeVita
Good day, In general I try to work within the limits of any database engine that I am using. Often, the limits are there for good reasons (such as speed problems). I would suggest seeing if there is a way to normalize the big tables such that infrequently used columns are split into tables that

Re: [sqlite] Limitation on Column count

2010-01-12 Thread Adam DeVita
gt; Essentially, we are talking about a time series (rows) of n different > > measurements (columns) - so normalization would lead to a doubling > > of the storage space (add a measurement_id to each measurement). > > > > Second, the most common use case is to view the table in the curren

Re: [sqlite] Newbie problem using special column name

2010-01-25 Thread Adam DeVita
Create the table using single quotes around the strange name. sqlite> create table x (boomer int, 'squid-nick' text); sqlite> insert into x values (1,'asdlh'); sqlite> select * from x; 1|asdlh sqlite> select squid-nick from x; SQL error: no such column: nick sqlite> select 'squid-nick' from x;

Re: [sqlite] The character "'" not liked by sqlite?

2010-03-02 Thread Adam DeVita
Good day, If you look in http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob for the function int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*)); This will allow you to bind any character into an SQL statement. There are other benefits to using this technique.

Re: [sqlite] Question about binding

2010-03-24 Thread Adam DeVita
Good day, For the sake of fun, I have to share this - especially with tall this talk of binding all the parameters. void poem(CString pth) { sqlite3_stmt *ppStmt; //statement pointer sqlite3 *db; //database const char *pzTail; char *pzerr; if( sqlite3_open(pth, ) ){

Re: [sqlite] Performance problem with count(*) calculation

2010-04-01 Thread Adam DeVita
How does $ time sqlite3 test32k.db "select count(1) from role_exist" perform? On Thu, Apr 1, 2010 at 5:52 AM, Alexey Pechnikov wrote: > Hello! > > $ time sqlite3 test32k.db "select count(*) from role_exist" > 1250 > > real0m58.908s > user0m0.056s > sys

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Adam DeVita
Is this a 1 off import? If so, perhaps the command line tool can .read it. On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < shaun.seck...@firaxis.com> wrote: > Greetings, > > I've got a .SQL file that contains multiple SQL insert statements for > various tables as well as comments

  1   2   >