Re: [sqlite] Would anyone know how to use Sqlite to calculate the streakedness of data? The definition of streakedness is show below. Thank you for your help

2013-02-19 Thread James K. Lowden
On Tue, 19 Feb 2013 05:37:38 -0800 Frank Chang wrote: > Would anyone know how to use Sqlite to calculate the streakedness of > data? The definition of streakedness is show below. Thank you for > your help. > > [EDIT] From our company's chief software architect, here is the > requirement for a st

Re: [sqlite] [PATCH] only build shell timer on platforms with getrusage()

2013-02-19 Thread Thomas Cort
> To make the suggested change would require that all makefiles for SQLlite > that are not built using configure (and there are lots of these) would have > to be revised to add -DHAVE_GETRUSAGE in order to get the .timer feature. > That is unacceptable. Okay. The reason for the patch is that the g

Re: [sqlite] database is locked with create

2013-02-19 Thread Choi, David
Hi Richard, Thank you Richard. I get the latest source(sqlite-amalgamation-3071502.zip) and cross-compile. And follow your instruction: sqlite3 -vfs unix-none ex1 That issue is gone. Really appreciated for your quick and exact response. David J. Choi -Original Message- From

Re: [sqlite] database is locked with create

2013-02-19 Thread Richard Hipp
On Tue, Feb 19, 2013 at 6:37 PM, Choi, David wrote: > Hi Richard, > > It seems that my version is not accept the command. By the way, what is > the version that you are referring to? > Get the latest: 3.7.15.1. There is no reason not to. > > Here is my operation: > /home # sqlite3 --help > Us

Re: [sqlite] SQLite error near "16": syntax error

2013-02-19 Thread Pavel Ivanov
On Tue, Feb 19, 2013 at 1:39 AM, mikkelzuuu wrote: > Hey guys, I'm getting this error (see title) > I'm using C# by the way. > > string StrQuery = @"INSERT INTO Test VALUES (" + > dataGridView1.Rows[i].Cells["Column1"].Value + ", " + > dataGridView1.Rows[i].Cells["Column2"].Value + ", " + > dataGr

Re: [sqlite] database is locked with create

2013-02-19 Thread Choi, David
Hi Richard, It seems that my version is not accept the command. By the way, what is the version that you are referring to? Here is my operation: /home # sqlite3 --help Usage: sqlite3 [OPTIONS] FILENAME [SQL] FILENAME is the name of an SQLite database. A new database is created if the file does n

Re: [sqlite] SQLite 4

2013-02-19 Thread Cory Nelson
On Tue, Feb 19, 2013 at 3:25 AM, Gabriel Corneanu wrote: > I understand, but I wanted to make a performance comparison. I read some > good news, but I need to test it for my case. > Am in a situation where the bottleneck is the CPU (sqlite), not IO. > Therefore I'm very interested in an early idea

[sqlite] :memory: performance in sqlite 3.6

2013-02-19 Thread Seebs
I'm afraid I haven't got a nicely isolated reproducer for this. I maintain a package, called pseudo, which includes a server built around an sqlite database. In the process of debugging some performance issues, I did some casual benchmarking. One of the first things I tried was an in-memory da

Re: [sqlite] database is locked with create

2013-02-19 Thread Richard Hipp
On Tue, Feb 19, 2013 at 4:39 PM, Choi, David wrote: > Hi Richard, > > I think your guess is highly possible because the error comes from > sqliteErrorFromPosixError(). In that case, how can I fix the issue? > Try adding the -vfs unix-none command-line option: sqlite3 -vfs unix-none ex1 Th

Re: [sqlite] database is locked with create

2013-02-19 Thread Choi, David
Hi Richard, I think your guess is highly possible because the error comes from sqliteErrorFromPosixError(). In that case, how can I fix the issue? Regards, David J. Choi -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rich

Re: [sqlite] database is locked with create

2013-02-19 Thread Choi, David
Hi Simon, Thank you for your clear instruction. But still I have the same issue. Here is my test procedures: #cd /home #sqlite3 ex1 SQLite version 3.6.23.1 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite>create table tbl1(one varchar(10),two smallint); sqlite3_e

Re: [sqlite] query optimization with "order by" in a view

2013-02-19 Thread Konrad Hambrick
> -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf > Of James K. Lowden > Sent: Tuesday, February 19, 2013 12:07 PM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] query optimization with "order by" in a view > > On Tue

Re: [sqlite] Is it possible to use SQLITE to calculate the streakedness of numeric data?

2013-02-19 Thread Frank Chang
joe.fis...@tanguaylab.com, Michael Black, Marc L. Allen, and Simon Slavin, Our software architect defined data streakedness based upon Chauvenet's criterion. Thank you for all of your help. In statistical theory, *Chauvenet's criterion* (named for William Chauvenet

Re: [sqlite] Is it possible to use SQLITE to calculate the streakedness of numeric data?

2013-02-19 Thread Frank Chang
joe.fis...@tanguaylab.com, Michael Black, Marc. L Allen and Simon Slavin, Thank you for your help in helping me to convince our company's software architect that it is possible to calculate the streakedness of numeric data. ___ sqlite-users mailing lis

[sqlite] Query Plan with FTS Tables

2013-02-19 Thread GB
Hi all, we are facing some Problems with Queries joining several FTS-Tables. There seems to be no equivalent to the ANALYZE Command for FTS-Indexes so they do not contain statistical info for the Query Planner. This sometimes leads to execution Plans with poor Performance. Some of them run 20

Re: [sqlite] query optimization with "order by" in a view

2013-02-19 Thread James K. Lowden
On Tue, 19 Feb 2013 10:19:26 +0100 "Gabriel Corneanu" wrote: > I included the "order by" in view because it's meant for some > end-users and I wanted to avoid mistakes. ... > Am I doing a mistake?? Well, yes, by including ORDER BY in the view definition. Most DBMSs don't allow that, and the SQL

Re: [sqlite] database is locked with create

2013-02-19 Thread Richard Hipp
On Tue, Feb 19, 2013 at 12:01 PM, Choi, David wrote: > Hi all, > > I am new to sqlite. I build sqlite with buildroot without any issue. After > loading sqlite on my embedded board, I always get one error > message:"database is locked". > > Here is my operation on my board: > > #sqlite3 ex1 > SQL

Re: [sqlite] database is locked with create

2013-02-19 Thread Simon Slavin
On 19 Feb 2013, at 5:01pm, "Choi, David" wrote: > I am new to sqlite. I build sqlite with buildroot without any issue. After > loading sqlite on my embedded board, I always get one error message:"database > is locked". > > Here is my operation on my board: > > #sqlite3 ex1 > SQLite version

Re: [sqlite] Required sqlite binaries for DOS urgently

2013-02-19 Thread Mahesh Chavan
Dear Sir, I am in computer field since 1988 and I have started my career with pc with two 360k floppy drivers. I have some accounting package I have written using sqlite as a back end and even though my pc is not accepting hard disk I have to run this software any how. I am on Windows platform and

[sqlite] database is locked with create

2013-02-19 Thread Choi, David
Hi all, I am new to sqlite. I build sqlite with buildroot without any issue. After loading sqlite on my embedded board, I always get one error message:"database is locked". Here is my operation on my board: #sqlite3 ex1 SQLite version 3.6.23.1 Enter ".help" for instructions Enter SQL statemen

Re: [sqlite] type definitions or aliases

2013-02-19 Thread Patrik Nilsson
On 02/19/2013 05:00 PM, Stephen Chrzanowski wrote: > My best suggestion would be to modify the code so when you compile the > string to make the select/delete/update, it uses the table name. For > testing purposes, you could have a combo box, or text field, or a text file > that has the contents t

Re: [sqlite] type definitions or aliases

2013-02-19 Thread Stephen Chrzanowski
My best suggestion would be to modify the code so when you compile the string to make the select/delete/update, it uses the table name. For testing purposes, you could have a combo box, or text field, or a text file that has the contents to point to the table you need. Either that, copy your subj

Re: [sqlite] type definitions or aliases

2013-02-19 Thread Patrik Nilsson
In my case I read the restriction of the triggers: I use database.table and I insert with default values. I can't use triggers for this. /Patrik On 02/19/2013 04:27 PM, Dave McKee wrote: >> Is it possible to use triggers for this? > > Yes. > > "Triggers may be created on views, as well as ordi

Re: [sqlite] Using VIEW as a foreign key?

2013-02-19 Thread Simon Slavin
On 19 Feb 2013, at 3:01pm, Thomas Knox wrote: > Is it possible to use a field in a VIEW as the foreign key for another > table? No. If this truly is the database structure that's useful to you I would suggest that either (A) you enforce your foreign keys in your software and not have SQLite

Re: [sqlite] Would anyone know how to use Sqlite to calculate the streakedness of data? The definition of streakedness is show below. Thank you for your help

2013-02-19 Thread Simon Slavin
On 19 Feb 2013, at 1:37pm, Frank Chang wrote: > Would anyone know how to use Sqlite to calculate the streakedness of data? Yes, technically it might be possible to do this as a collection of SQL statements and table updates, but it would be extremely inefficient. SQLite is a database manageme

Re: [sqlite] type definitions or aliases

2013-02-19 Thread Dave McKee
> Is it possible to use triggers for this? Yes. "Triggers may be created on views, as well as ordinary tables, by specifying INSTEAD OF in the CREATE TRIGGER statement. If one or more ON INSERT, ON DELETE or ON UPDATE triggers are defined on a view, then it is not an error to execute an INSERT, D

Re: [sqlite] type definitions or aliases

2013-02-19 Thread Patrik Nilsson
Quite good, but I read that "You cannot DELETE, INSERT, or UPDATE a view". I need to do that! Is it possible to use triggers for this? Patrik On 02/19/2013 04:06 PM, Stephan Beal wrote: > On Tue, Feb 19, 2013 at 4:04 PM, Patrik Nilsson > wrote: > >> (some alias command: abc is an alias of abc_v

Re: [sqlite] type definitions or aliases

2013-02-19 Thread Stephan Beal
On Tue, Feb 19, 2013 at 4:04 PM, Patrik Nilsson wrote: > (some alias command: abc is an alias of abc_v1 for this connection) > > select * from abc > > (The last command would then "select * from abc_v1".) > How about: CREATE TEMPORARY VIEW abc AS SELECT * FROM abc_v1; e.g. sqlite> create tempo

[sqlite] type definitions or aliases

2013-02-19 Thread Patrik Nilsson
Hi, I change database format frequently and would like to have an easy way to distinguish the tables. Is it possible to have a pointer (like typedef in C) that points to the current used table? As an temporary pointer? Example: I have a table named abc, which I version as abc_v1, abc_v2, ... Ca

[sqlite] Using VIEW as a foreign key?

2013-02-19 Thread Thomas Knox
Hello, Is it possible to use a field in a VIEW as the foreign key for another table? Something like: CREATE TABLE "stuff" ("id" INTEGER PRIMARY KEY NOT NULL, "desc" TEXT); CREATE TABLE "morestuff" ("id" INTEGER PRIMARY KEY NOT NULL, "desc" TEXT); CREATE VIEW "allstuff" AS SELECT id, desc FROM stu

Re: [sqlite] Required sqlite binaries for DOS urgently

2013-02-19 Thread Ryan Johnson
On 19/02/2013 8:08 AM, Mahesh Chavan wrote: My IDE bus is refusing to recognise my HDD or CDROM, I am compelled to access my PC using floppy only. I intend to run all my database software on floppy using sqlite3. I need to develop the software on warfooting. I have already compiled some programs

Re: [sqlite] [PATCH] only build shell timer on platforms with getrusage()

2013-02-19 Thread Richard Hipp
On Thu, Feb 14, 2013 at 6:49 AM, Thomas Cort wrote: > Hello, > > The timer code in src/shell.c relies heavily on getrusage(). Some > platforms, Minix for example, don't have getrusage() yet, but it may > get it in the future. The attached patch "patch-configure.ac" adds a > check for the getrusag

Re: [sqlite] Would anyone know how to use Sqlite to calculate the streakedness of data? The definition of streakedness is show below. Thank you for your help

2013-02-19 Thread Marc L. Allen
I haven't done SQLite coding in several months, and it's quite rusty, so I'll paraphrase. I haven't tested and if this is bogus, I'm sorry in advance. But maybe it'll give someone the right idea. You might be better off with a custom function, though. It would be something like this: CREATE

[sqlite] Would it be possible to use SQLIte to calculate Chauvents Criterion as a proxy for data streakedness?

2013-02-19 Thread Frank Chang
Good morning, Would it be possible to use SQLIte to calculate Chauvents Criterion as a proxy for data streakedness? Thank you. http://math.stackexchange.com/questions/198105/chauvenets-criterion-all-my-data-points-are-outliers?rq=1 ___ sqlite-users mai

Re: [sqlite] query optimization with "order by" in a view

2013-02-19 Thread Richard Hipp
On Tue, Feb 19, 2013 at 8:30 AM, Gabriel Corneanu wrote: > I hoped it was either a slip or would be relatively simple to implement. > Good rule of thumb: Nothing is ever simple in a query optimizer -- D. Richard Hipp d...@sqlite.org ___ sqlite-user

Re: [sqlite] query optimization with "order by" in a view

2013-02-19 Thread Gabriel Corneanu
It's hard to accept this conclusion... it seems like a simple justification. If you say so, why is "select from v order by id" not doing a sort (with the data from view)? Obviously it "sees" the id is the primary key and uses it for sorting. I read here lots of messages about complex query opti

[sqlite] Required sqlite binaries for DOS urgently

2013-02-19 Thread Mahesh Chavan
My IDE bus is refusing to recognise my HDD or CDROM, I am compelled to access my PC using floppy only. I intend to run all my database software on floppy using sqlite3. I need to develop the software on warfooting. I have already compiled some programs in Puppy Linux previously. When I tried to com

Re: [sqlite] SQLite error near "16": syntax error

2013-02-19 Thread Michael Black
What does the built StrQuery actually look like? That should 'splain things. I imagine the 16 is in your dataGridView values. And are those values numbers or strings? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of mikkelzuuu

Re: [sqlite] SQLite error near "16": syntax error

2013-02-19 Thread Clemens Ladisch
mikkelzuuu wrote: > string StrQuery = @"INSERT INTO Test VALUES (" + > dataGridView1.Rows[i].Cells["Column1"].Value + ", " + > dataGridView1.Rows[i].Cells["Column2"].Value + ", " + > dataGridView1.Rows[i].Cells["Column3"].Value + ", " + > dataGridView1.Rows[i].Cells["Column4"].Value + ", " + > data

[sqlite] SQLite error near "16": syntax error

2013-02-19 Thread mikkelzuuu
Hey guys, I'm getting this error (see title) I'm using C# by the way. string StrQuery = @"INSERT INTO Test VALUES (" + dataGridView1.Rows[i].Cells["Column1"].Value + ", " + dataGridView1.Rows[i].Cells["Column2"].Value + ", " + dataGridView1.Rows[i].Cells["Column3"].Value + ", " + dataGridView1.Row

Re: [sqlite] query optimization with "order by" in a view

2013-02-19 Thread Simon Slavin
On 19 Feb 2013, at 9:19am, "Gabriel Corneanu" wrote: > As a summary, it seems that having multiple "order by" disturbs the query > builder; of course, I expected the "optimizer" to recognize that i was the > same order and avoid extra sorting. > Am I doing a mistake?? I think you have figured

Re: [sqlite] SQLite 4

2013-02-19 Thread Gabriel Corneanu
I understand, but I wanted to make a performance comparison. I read some good news, but I need to test it for my case. Am in a situation where the bottleneck is the CPU (sqlite), not IO. Therefore I'm very interested in an early idea about performance. Even if it's not ready, I could at least p

[sqlite] query optimization with "order by" in a view

2013-02-19 Thread Gabriel Corneanu
I need some clarifications on this issue. Here is a simplified example. There is a table: CREATE TABLE t(id integer primary key, data integer); and a (simplified) view: CREATE VIEW v as SELECT * FROM "t" order by id; I included the "order by" in view because it's meant for some end-users and I

Re: [sqlite] creating a summary table

2013-02-19 Thread Paul Sanderson
That did the job - Thank You On 18 February 2013 18:15, James K. Lowden wrote: > On Mon, 18 Feb 2013 17:02:53 + > Paul Sanderson wrote: > > > nc > > 1a > > 2a > > 3a > > 4b > > 5b > > 3b > > 4b > > 2b > > 3a > > 5b > > 2b > > > > > > I have a

Re: [sqlite] SQLite 4

2013-02-19 Thread Dan Kennedy
On 02/19/2013 03:50 PM, Gabriel Corneanu wrote: I am also on final steps of a new project, and I would love to compare sqlite4 before release (the data files will be public, therefore a later switch would be problematic). Is there any chance to get it for windows? I usually need the dll. Last tim

Re: [sqlite] SQLite 4

2013-02-19 Thread Gabriel Corneanu
I am also on final steps of a new project, and I would love to compare sqlite4 before release (the data files will be public, therefore a later switch would be problematic). Is there any chance to get it for windows? I usually need the dll. Last time I could not compile it (mingw), there are s