[sqlite] View workarounds

2016-05-23 Thread R Smith
On 2016/05/23 7:52 PM, Balaji Ramanathan wrote: > Thank you very much for all your comments. > > I thought about including all the columns in my view and then selecting > just what I need, but that is almost as painful as repeating the view's > query in adding the filters I want. Modifying both

[sqlite] Binary Difference in Sqlite database files instead of SQLdiff and patch ?

2016-05-23 Thread Simon Slavin
On 23 May 2016, at 9:08pm, Piyush Shah wrote: > We know about sqldiff https://www.sqlite.org/sqldiff.html and would use it > to generate diffs and patch them but we were hoping there was a way to do do > a binary diff of the database because otherwise we will have to figure out a > way for

[sqlite] Binary Difference in Sqlite database files instead of SQLdiff and patch ?

2016-05-23 Thread Piyush Shah
Hi, We are using the Sparkle Project https://sparkle-project.org/ to manage a Mac OS X application updates that has an embedded sqlite database. We were hoping that the Sparkle project would be able to detect differences in the SQLite database file and include that in the Delta it generates

[sqlite] View workarounds

2016-05-23 Thread Balaji Ramanathan
Thank you for continuing with this thread, Ryan. I don't have nuclear launch codes in my database, but it is over 4MB in size. But the data in it is not that important. Let me post the view I am interested in: select Trip.TripID as 'Trip Number', Mode.Mode as 'Mode', TripOD.TripOD as

[sqlite] View workarounds

2016-05-23 Thread Dominique Devienne
On Mon, May 23, 2016 at 4:49 PM, Steve Schow wrote: > My suggestion is add the extra columns you need to the view, then when you > make a query against that view, only specify the more limited set of output > columns you want in the final output > SQLite almost supports what's needed, but only

[sqlite] View workarounds

2016-05-23 Thread R Smith
On 2016/05/23 3:02 PM, Balaji Ramanathan wrote: > Hi, > > I have created some views in my database by joining multiple tables to pull > out specific columns from these tables without having to remember the exact > SQL and joins (easy repeatability). But it looks like I have misunderstood > how

[sqlite] View workarounds

2016-05-23 Thread Jean-Luc Hainaut
As long as you don't try to modify data, a view just behaves like a base table. So, like in base tables, you can't extract, filter, sort, group by, etc. based on non-existing columns. SQLite views are read-only, but modifying data through a view can be done with "instead of" triggers. J-L

[sqlite] constraint failed message and no clue what went wrong

2016-05-23 Thread Bernd Lehmkuhl
> Dominique Devienne hat am 23. Mai 2016 um 13:42 > geschrieben: > > > On Mon, May 23, 2016 at 12:22 PM, Bernd Lehmkuhl mailbox.org > > wrote: > > > > > Dominique Devienne hat am 23. Mai 2016 um 11:20 > > geschrieben: > > > On Mon, May 23, 2016 at 10:39 AM, Bernd Lehmkuhl < > >

[sqlite] Updating the 'default' clause of a column?

2016-05-23 Thread Olivier Mascia
Thanks Simon! Don't worry about the type 'timestamp'. We know how SQLite works with types. We use timestamp because it is a good thing for documentation purpose. We actually store an integer or real in there according to our application rules. For the short story we initially chose to always

[sqlite] constraint failed message and no clue what went wrong

2016-05-23 Thread Dominique Devienne
On Mon, May 23, 2016 at 12:22 PM, Bernd Lehmkuhl wrote: > > > Dominique Devienne hat am 23. Mai 2016 um 11:20 > geschrieben: > > On Mon, May 23, 2016 at 10:39 AM, Bernd Lehmkuhl < > bernd.lehmkuhl at mailbox.org > > > [...] What might cause a "constraint failed" message following > this command:

[sqlite] View workarounds

2016-05-23 Thread Balaji Ramanathan
Thank you very much for all your comments. I thought about including all the columns in my view and then selecting just what I need, but that is almost as painful as repeating the view's query in adding the filters I want. Modifying both the select clause and the WHERE clause of the query is

[sqlite] constraint failed message and no clue what went wrong

2016-05-23 Thread Bernd Lehmkuhl
> Dominique Devienne hat am 23. Mai 2016 um 11:20 > geschrieben: > > > On Mon, May 23, 2016 at 10:39 AM, Bernd Lehmkuhl mailbox.org > > wrote: > > > [...] What might cause a "constraint failed" message following this > > command: [...] > > > > Which version of SQLite? More recent ones tell

[sqlite] SQL logic error or missing database no such table

2016-05-23 Thread R.A. Nagy
Are we sure that data are being stored at-all? Also, how is the database being encrypted? On Sun, May 22, 2016 at 3:02 PM, Rajendra Shirhatti wrote: > Hi Randall, > Thank you so much for your reply. > I don't have enough data to confirm whether database file is missing or > it's due to some

[sqlite] Updating the 'default' clause of a column?

2016-05-23 Thread Olivier Mascia
Hello, Assume a table simplified for this discussion as: create table T(C timestamp default (julianday()) not null); I simply have to use a new function (let's call it 'now()' other than julianday() to define the default for this column. I have apparently successfully tested this:

[sqlite] Updating the 'default' clause of a column?

2016-05-23 Thread Simon Slavin
On 23 May 2016, at 11:14am, Olivier Mascia wrote: > But am I missing some important detail that could hurt me later? I notice only one thing, but you're at the time when it's easy to change it. The 'type' you've picked for this column is 'timestamp'. SQLite has no such type. I recommend

[sqlite] SQL logic error or missing database no such table

2016-05-23 Thread Rajendra Shirhatti
Yes, I'm very positive the data is stored otherwise the application would throw some exception. The database is encrypted by calling passing a private key to the connection using ChangePassword(). Thank you, Raj On Mon, May 23, 2016 at 9:16 AM, R.A. Nagy wrote: > Are we sure that data are

[sqlite] constraint failed message and no clue what went wrong

2016-05-23 Thread Dominique Devienne
On Mon, May 23, 2016 at 10:39 AM, Bernd Lehmkuhl wrote: > [...] What might cause a "constraint failed" message following this > command: [...] > Which version of SQLite? More recent ones tell you which constraint failed, when they are named, which yours are (a good thing IMHO). So using a

[sqlite] System.Data.SQLite fails on rtree index creation (NuGet install)

2016-05-23 Thread Joe Mistachkin
Jason Doherty wrote: > >CREATE VIRTUAL TABLE IF NOT EXISTS TASK_SPX USING rtree(id, minx, maxx, > miny, maxy); > > fails with > >SQLite error (1); no such table: main.sqlite_stat1 > Could you run the SQL query "ANALYZE;" on the database and see if that clears the issue? -- Joe

[sqlite] constraint failed message and no clue what went wrong

2016-05-23 Thread Bernd Lehmkuhl
Dear list, having the following database schema: /*** t_geometrie_typ ***/ CREATE TABLE t_geometrie_typ( auto_id INTEGER PRIMARY KEY AUTOINCREMENT, -- automatically generated id as link to the r*Tree index id TEXT UNIQUE NOT NULL, typ TEXT COLLATE NOCASE NOT NULL, objektart TEXT NOT

[sqlite] View workarounds

2016-05-23 Thread Steve Schow
My suggestion is add the extra columns you need to the view, then when you make a query against that view, only specify the more limited set of output columns you want in the final output As others have said already, don?t think of a view as a stored query. Think of it as multiple joined

[sqlite] View workarounds

2016-05-23 Thread Balaji Ramanathan
Hi, I have created some views in my database by joining multiple tables to pull out specific columns from these tables without having to remember the exact SQL and joins (easy repeatability). But it looks like I have misunderstood how views work and have run into some limitations when using these

[sqlite] input using a dropdown list

2016-05-23 Thread Gary Ehrenfeld
Everything works great. Again I had another typo but I saw it and once fixed run great. Thank you for all your help. On 5/22/16, 16:45, "Simon Slavin" wrote: > >On 23 May 2016, at 12:37am, Gary Ehrenfeld wrote: > >> It works but how do I get it to work with an input statement so I can insert

[sqlite] input using a dropdown list

2016-05-23 Thread Simon Slavin
On 23 May 2016, at 12:37am, Gary Ehrenfeld wrote: > It works but how do I get it to work with an input statement so I can insert > it into the hive_type column in the hive table. I don't see anything you did wrong. Have it construct the and tags, View the Source of the page and look at

[sqlite] input using a dropdown list

2016-05-23 Thread Simon Slavin
On 22 May 2016, at 11:57pm, Gary Ehrenfeld wrote: > I corrected the results to result and everything works. Thank for seeing > that. I feel really stupid right now. Don't feel bad. We've all done it. Second pair of eyes always helps. Simon.

[sqlite] input using a dropdown list

2016-05-23 Thread Simon Slavin
On 22 May 2016, at 11:46pm, Gary Ehrenfeld wrote: > Yes. Here is the code I am using but when I run it all I get is an empty list. Just as a test, replace your code which makes the dropdown list with code which just shows the options on the display: "".$value."" Get that working first, then

[sqlite] input using a dropdown list

2016-05-23 Thread Simon Slavin
On 22 May 2016, at 11:15pm, Gary Ehrenfeld wrote: > Any suggestions? I am using SQLIte3 and PHP. Before you try to make a dropdown list with options taken from a SQLite database, do you know how to make a dropdown list with fixed text options ? Simon.