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] 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] 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] 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] sqlite connection?

2010-05-11 Thread Adam DeVita
Yes. One can also attach 'somedatabase path' as anothername ; and you can run a query accessing both at the same time. regards, Adam On Tue, May 11, 2010 at 1:45 PM, john cummings wrote: > hi all, > > i'm new to this forum and sqlite. > > is it possible to have an

Re: [sqlite] Update: set multiple values

2010-05-11 Thread Adam DeVita
but... ...but I LOVE my hammer! How dare every problem not be a nail? ;) Good point. Likely all the updates can fit nicely into a transaction. On Mon, May 10, 2010 at 5:11 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 10 May 2010, at 9:25pm, Adam DeVita wrote: >

Re: [sqlite] Update: set multiple values

2010-05-10 Thread Adam DeVita
Simon, can you expand your syntax, or are you just saying, "get x,y,z store them in a set of variables, then run update with appropriate bindings"? Hopefully this related question isn't called hijacking a thread. I feel this belongs together under set multiple values using the update query. I'm

Re: [sqlite] Returning column to default

2010-05-06 Thread Adam DeVita
Is there a primary key on the table? Is it possible to use insert or replace instead of update, and then not reference the column you want to set as a default? On Thu, May 6, 2010 at 10:41 AM, Andy Gibbs wrote: > > You could write a trigger that sets default value if

Re: [sqlite] WHERE = does not work

2010-04-30 Thread Adam DeVita
Is it possible there is a null, tab, newline or other invisible character? Try select timeStamp, '' || resourceType || 'xx' From MyTable where resourceType like 'PSM' LIMIT 10; On Fri, Apr 30, 2010 at 9:53 AM, ecforu wrote: > I don't think it is a case issue.

Re: [sqlite] column output truncating

2010-04-23 Thread Adam DeVita
Could you include a bit more information about your post? (Version number, operating system etc.) I'm unsure if you have compiled something or are using the command line tool. There are lots of very knowledgeable and helpful people on the list. On Thu, Apr 22, 2010 at 6:31 PM, Derek Martin

Re: [sqlite] Date Dimension

2010-04-22 Thread Adam DeVita
good ideas. The spread sheet trick hadn't occurred to me. I think I'll go that route since it keeps things user readable thank you for your thoughts, all. regards, Adam On Thu, Apr 22, 2010 at 2:51 AM, Oliver Peters <oliver@web.de> wrote: > > Adam DeVita <adev

Re: [sqlite] Date Dimension

2010-04-21 Thread Adam DeVita
year, age from epoch, month name, etc? regards, Adam On Wed, Apr 21, 2010 at 3:59 PM, P Kishor <punk.k...@gmail.com> wrote: > On Wed, Apr 21, 2010 at 2:37 PM, Adam DeVita <adev...@verifeye.com> wrote: > > Yes. > > > > A Date dimension is a table that ha

Re: [sqlite] Date Dimension

2010-04-21 Thread Adam DeVita
obably OP meant this: > http://en.wikipedia.org/wiki/Dimension_(data_warehouse)<http://en.wikipedia.org/wiki/Dimension_%28data_warehouse%29> > . > But I don't have any answer to the question asked. > > > Pavel > > On Wed, Apr 21, 2010 at 3:21 PM, P Kishor <punk.k...@gmail.com&g

[sqlite] Date Dimension

2010-04-21 Thread Adam DeVita
Good day, Given the context I'm in, sqlite is going to be used for our data warehousing. (We generate about 2MB of raw data in a month, so we don't think we need a heavy DB engine.) Since most warehouses have one, which are very similar from application to application, I'm wondering if there

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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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:

[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] .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,

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] 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] 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
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] 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] 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] 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] 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] 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] 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

[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] 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, > >

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] 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] 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] 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] 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] 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] 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

[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

<    1   2