[sqlite] Using CTE with INSERT

2015-10-13 Thread Don V Nielsen
The syntax "WITH p AS (SELECT 1) INSERT INTO t(x) SELECT * FROM p;" throws the same exception: "[2015-10-13 08:20:22] [1] [SQLITE_ERROR] SQL error or missing database (near ")": syntax error)" On Tue, Oct 13, 2015 at 8:17 AM, Clemens Ladisch wrote: > Don V Nie

[sqlite] Using CTE with INSERT

2015-10-13 Thread Don V Nielsen
x below is incorrect, hopefully it conveys what I am trying to accomplish. Can someone assist? Your time and consideration is much appreciated. don v nielsen Note: CTAS would work in this scenario. But I cannot figure out that syntax, as well. insert into vo_crrt_pieces (recid) values ( with -

[sqlite] CSV excel import

2015-07-31 Thread Don V Nielsen
I use the Ruby scripting language and its abundance of libraries to read excel files then write the output to sqlite. Those libraries, whether they r/w csv or excel files are robust, sometime robust beyond belief. They are likely more robust than what applications developers write into their apps

[sqlite] User-defined types

2015-06-05 Thread Don V Nielsen
> How can you defend SQL syntax other than on grounds of history or standardization? Short answer: QWERTY. Long answer: IBM mainframe DOS -> Z/OS. A 1960's o/s that is still supported by the inner workings of its most modern o/s. There's is nothing wrong with supporting the past. Sometimes

[sqlite] FW: Very poor SQLite performance when using Win8.1 + Intel RAID1

2015-03-26 Thread Don V Nielsen
This discussion, and you guys, are amazing. I am learning so much! On Wed, Mar 25, 2015 at 8:56 PM, Keith Medcalf wrote: > > On Wednesday, 25 March, 2015 10:42, Simon Slavin > said: > > >On 25 Mar 2015, at 1:47pm, Rob van der Stel < > RvanderStel at benelux.tokheim.com> wrote: > > >> One open

Re: [sqlite] Discrepancy with indexing and WHERE clause with AND/OR

2014-11-10 Thread Don V Nielsen
Isn't this the result of the results cache? The two queries are identical. On Mon, Nov 10, 2014 at 9:26 AM, Clemens Ladisch wrote: > RP McMurphy wrote: > > Is there a way we can make the w index work with both queries and not > > have to run external loops to flatten all the WHERE clauses? > >

Re: [sqlite] SQLite as a meta database

2014-11-05 Thread Don V Nielsen
Wow! Please keep this discussion up-to-date because it is absolutely fascinating what all of you are doing. Thanks, dvn On Wed, Nov 5, 2014 at 8:36 AM, Hugo Mercier wrote: > Hi, > > Le 05/11/2014 14:16, Hick Gunter a écrit : > > Hi, > > > > we have extensive experience with respect to the use

Re: [sqlite] Single large table vs. several smaller tables

2014-10-09 Thread Don V Nielsen
> concerned with organizational clarity and correctness than efficiency >From my personal experience, Sqlite is so bloody fast I simply side table efficiency until it needs to be looked at. I can load 1.5 million name address records (500 bytes each), a second table of 3 million records (same siz

Re: [sqlite] Single large table vs. several smaller tables

2014-10-09 Thread Don V Nielsen
I suggest you group columns into a structures that you are comfortable with. I have a name, own a home, and have one car. Everything is singular to me, an individual. So if I have a table Individuals, do I want 25 columns that encompass name, address, year, make, and model of my car, type of hom

Re: [sqlite] Unhandled Exception: System.TypeInitializationException

2013-04-06 Thread Don V Nielsen
AM, Bernd wrote: > Am 05.04.2013 22:19, schrieb Don V Nielsen: > > Thanks for reading. I am getting the following error moving a 32 bit >> application from Windows Server 2003 to WS2008. This is a straight copy >> from one computer to another. It runs fine on WS2003 and

[sqlite] Unhandled Exception: System.TypeInitializationException

2013-04-05 Thread Don V Nielsen
Thanks for reading. I am getting the following error moving a 32 bit application from Windows Server 2003 to WS2008. This is a straight copy from one computer to another. It runs fine on WS2003 and not so good on WS2008. The application was compiled with VS2005. I do not have a development env

Re: [sqlite] Parameterized SQL

2012-06-15 Thread Don V Nielsen
I use Ruby. In the following example I use a replacement tag "#{lvl}" in the scripts. For each of the levels (indv,hhld,resi), I do a substitution against the script and pass the script to sqlite. dbname = File.join('d:','cloveretl','projects','test_ii','data-out-97','test.db') db = SQLite3::Dat

Re: [sqlite] Downgrade support for OS/2?

2012-04-03 Thread Don V Nielsen
Well. I know some banks and some transportation systems still use OS/2. Do they use sqlite? If yes, I'm sure their apps are stable, meaning their sqlite implementation is stable. Does sqlite need to continue for OS/2? Most likely not. Death of a friend. I always liked OS/2. It's still bette

Re: [sqlite] User input checking

2012-03-23 Thread Don V Nielsen
Ruby on Rails -- ActiveRecord. ActiveRecord prevents sql injections, I think. Using ERB in the html would give you that kind of functionality. Correct? dvn On Fri, Mar 23, 2012 at 2:49 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I also forgot to mention doing

Re: [sqlite] 64-bit Windows Command Shell

2012-03-22 Thread Don V Nielsen
There is a natural 5th extrapolation: 5) Could sqlite3 take advantage of multiple cpu's by parsing a single task into one thread per cpu and segment data to be worked by each thread? Big league stuff. But I don't think sqlite3 is meant to compete in that market. It already exceeds expectations

Re: [sqlite] why one row's results isn't the same between program and command shell

2012-03-21 Thread Don V Nielsen
Doh! Know the feeling. Well! On Wed, Mar 21, 2012 at 2:38 PM, Simon Slavin wrote: > > On 21 Mar 2012, at 7:35pm, Adam DeVita wrote: > > > Sorry for false alarm. Please disregard this thread: > > > > Solution: make sure you quit everything and isolate the code. There is a > > subsequent writ

Re: [sqlite] What do people think of SQLite Root?

2012-03-07 Thread Don V Nielsen
Thumbs up on SqliteExpert. I use it too. Very nice. dvn On Tue, Mar 6, 2012 at 7:20 PM, Stephen Chrzanowski wrote: > I use SQLite Expert. There is a fee for the professional version, but it > is one time, all updates are free. > > http://www.sqliteexpert.com/ > > > On Tue, Mar 6, 2012 at 1:43

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Don V Nielsen
Ya know, if you ever wanted to deviate from the SQL standard, a handy upgrade to the CASE statement would permit split conditions on the case and when statement, as in: Case price1 when > 12 then 1 when > 30 then 2 else 0 end dvn On Thu, Mar 1, 2012 at 12:43 PM, Don V Nielsen

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Don V Nielsen
I think Simon's solution is in error, and Igor's is correct. In Simon's case, Slevel will be set to 1 if price1 is greater than 30. However, the original c function would set Slevel to 2 because price1 is greater than 12 and it is greater than 30. Two increments of i are executed in that scenari

Re: [sqlite] Inserts get slower and slower

2012-02-24 Thread Don V Nielsen
arse_Record • 332 ms • CDG.UtiI.FL_FirstLogic.Parse_FmtDef.Parse(RecordString) 0.62 % [Native or optirnized code] 191 ms 4 Thread #2 • 30,628 ms 100.00 % [Native or optimized code] 30,628 ms On Thu, Feb 23, 2012 at 4:02 PM, Don V Nielsen wrote: > Follow-up on this issue. > > This morning I used a JetBrains product

Re: [sqlite] Limit on the Compound Select Statements

2012-02-24 Thread Don V Nielsen
Would it make more sense to put the values into a text file and import the text file? It separates the data from the application, and simplifies making future changes to the list. On Thu, Feb 23, 2012 at 1:52 PM, Abhinav Upadhyay < er.abhinav.upadh...@gmail.com> wrote: > On Thu, Feb 23, 2012 at

Re: [sqlite] Inserts get slower and slower

2012-02-24 Thread Don V Nielsen
ael D. Black > > Senior Scientist > > Advanced Analytics Directorate > > Advanced GEOINT Solutions Operating Unit > > Northrop Grumman Information Systems > > ____ > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]

Re: [sqlite] SQLite shell dot commands

2012-02-24 Thread Don V Nielsen
Please, I don't mean this to be offensive. I'm not. It was suggested that the syntax "[Ben's table]" is cumbersome. What is really cumbersome, in my opinion, is the table name itself. The table name includes an white space (space) and a delimiting character (apostrophe.) The simple table name

Re: [sqlite] Inserts get slower and slower

2012-02-09 Thread Don V Nielsen
I've noticed a similar thing happening. The first 1/3rd loads quickly; the remain 2/3rds stagnates. It appears that there is some kind of bottleneck happening. I thought it was the SAN. My application begins a transaction, does all its inserts, and then commits. There could be millions in the

Re: [sqlite] support of %y in strftime()

2012-02-03 Thread Don V Nielsen
But if we don't start worrying about the year 10,000 now, then we'll end of having another disaster like Y2k. Oh yeah, that amounted to big fat thud. Never mind. :) On Fri, Feb 3, 2012 at 8:39 AM, Black, Michael (IS) wrote: > Non-standard ISO formatalready doable like this: > > > > sqlite>

Re: [sqlite] C# amalgamation hand holding requested

2012-01-25 Thread Don V Nielsen
> > > > Advanced Analytics Directorate > > > > Advanced GEOINT Solutions Operating Unit > > > > Northrop Grumman Information Systems > > > > > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.o

Re: [sqlite] C# amalgamation hand holding requested

2012-01-24 Thread Don V Nielsen
Ok. So I am doing things correctly. I am already doing things correctly. I am using the provided .NET dll. I copy it to my local project. And when that project moves to production, it will be in the project's .bin folder. I should not have to worry about the dll hell associated with HP and Qu

[sqlite] C# amalgamation hand holding requested

2012-01-20 Thread Don V Nielsen
I need help using the amalgamation in my projects. I simply do not know what steps to take in VS to implement it. I have some fairly elaborate projects that I have been redeveloping to use sqlite instead of .net structure and memory functions. One project is complete, but it uses the sqlite dll.

Re: [sqlite] Optimizing a query with range comparison.

2011-12-27 Thread Don V Nielsen
I do something similar, where the ranges are zip codes. However, my tableb is arranged vertically with one key (zip code) and one value (geographic zone). I would then join the two tables using the zip code, rather than trying to identify the zip code within a range of zip codes in tableb. Matchi

Re: [sqlite] Parameters are not allowed in views

2011-12-22 Thread Don V Nielsen
Where can I learn more about "restrict it". I'm not familiar with the syntax for using the question mark. Is there a specific part of the documentation that explains it and how it works? Thanks, dvn On Wed, Dec 21, 2011 at 5:00 PM, Petite Abeille wrote: > > On Dec 21, 2011, at 11:40 PM, Chris

Re: [sqlite] FW: Which version of SQLite?

2011-12-16 Thread Don V Nielsen
Ruby is awesome, especially when working with Sqlite...using ActiveRecord. But its I/O is really slow, so propagating a database is not its thing. dvn On Wed, Dec 14, 2011 at 8:32 PM, Nataraj S Narayan wrote: > Hi > > I am also an ex-clipper. I miss the old 'code blocks' days. I think > Ruby co

Re: [sqlite] SQLite with Vis. Studio C#

2011-12-16 Thread Don V Nielsen
My application never uses a DataSet. I push all db responsibility to sqlite. It returns DbDataReaders when I need to recurse through results. On Thu, Dec 15, 2011 at 1:40 PM, Jeff Matthews wrote: > Regarding my earlier question as to .NET SQlite syntax, I was wondering if > I > had to use Da

Re: [sqlite] SQLite with Vis. Studio C# Entity Framework 4.1

2011-12-14 Thread Don V Nielsen
While I love working with C# and Sqlite, I'm quite an amateur at it even though I'm doing some sophisticated programming for my employer. And even less at exploiting the capabilities of Visual Studio in helping me. Below is a very typical routine for me. I use string.Format a lot to assemble the

Re: [sqlite] Very slow query

2011-12-02 Thread Don V Nielsen
I've been thinking that I am experiencing something similar, but I have no solid facts nor am I good enough to really figure it out. I have a view using a view. It feels slow. I'm using the second view to relieve my program from having to dynamically construct multiple times a union of 1 to x ta

Re: [sqlite] Looping select

2011-11-30 Thread Don V Nielsen
There is too much ambiguity with regards to needid; poor coding|edit checking on my part. When I label everything properly, then the query runs successfully (darn fast, too). I also changed the replacement tag @depth to @dpth. When I was examining everything with notepad++, it highlighted @depth

[sqlite] Looping select

2011-11-29 Thread Don V Nielsen
This one is weird. And I don't know exactly what I have the ability to provide you for information. Below is the C# code I use to execute a query. And below that is what is ultimately translated and executed. The c# application appears to get hung up and loops. It burns cpu, but never stops.

[sqlite] Confused by DELETE statement error

2011-11-21 Thread Don V Nielsen
I'm confused by the error message, "near 'order' : syntax error", with the following statement. The same statement, beginning with "select *" in place of "delete", will function fine. delete from seg_ny_adds where needid = 90 order by prty desc limit (select count() from seg_ny_adds where needid

Re: [sqlite] Proper way to change temp directory

2011-11-21 Thread Don V Nielsen
In Ruby (just for giggles), its Dir.chdir('dir text') {|dir| # do your sort stuff here } # previous directory restored when logic block is completed On Sun, Nov 20, 2011 at 3:50 AM, Yang Zhang wrote: > Cool beans, perhaps this should be added to the docs! > > On Sun, Nov 20, 2011 at 1:36

Re: [sqlite] Using "sub-select" to return limit

2011-11-04 Thread Don V Nielsen
u have to select > data from your table of limits into your programming language, iterate > through results and for each row issue separate select statement with > appropriate limit (which will be a constant not a nested select > query). > > > Pavel > > > On Thu, Nov 3,

Re: [sqlite] sql server management studio like tool for SQLite

2011-11-03 Thread Don V Nielsen
If you are looking to manage a database file, such as view the contents of tables, write and test scripts for processing, etc...there are a number of management packages. I like using Sqlite Expert. If you are looking for something that is going to do DTS, bulk imports, etc...I don't know what ex

[sqlite] Using "sub-select" to return limit

2011-11-03 Thread Don V Nielsen
Given the following, I get an error that f.zip does not exist. Obviously, I am mentally missing something contextually, but I'm not getting it. Would someone work through the scope of things in this select. select p.*,pr.rowid from pool_wi as p inner join add_priorities as pr on pr.prty = p.prty

Re: [sqlite] Slow INDEX

2011-11-02 Thread Don V Nielsen
I would like to stick my neck out over the chopping block and agree. My experience is the opposite, but appears to support Puneet's assertion. With me, it takes my C# application 12 seconds to pass 103,00 records and insert 98,000 rows into the db from it. The next time I run the application (wh

Re: [sqlite] UPDATE

2011-11-01 Thread Don V Nielsen
Igor Tandetnik wrote: > Don V Nielsen wrote: > > I need help with a complex UPDATE. I want to update each row in a table, > > calculating an average, and then apply that value back into a column of > the > > same row. Is this possible with Sqlite? Below is code that should

[sqlite] UPDATE

2011-10-31 Thread Don V Nielsen
I need help with a complex UPDATE. I want to update each row in a table, calculating an average, and then apply that value back into a column of the same row. Is this possible with Sqlite? Below is code that should work with SqlServer; its UPDATE supports a FROM statement. UPDATE m SET rtwgt =

Re: [sqlite] SQLite Expert

2011-10-31 Thread Don V Nielsen
I use the free version of sqlite expert. I use sqlite for my IO handling. Having the power of sql available to test values, generate counts, etc... is indispensable. On Sun, Oct 30, 2011 at 2:50 PM, Abair Heart wrote: > Hi all, > > Searching the archives implies, that "sqlite expert" hasn't be

<    1   2