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

2011-12-13 Thread Joe Mistachkin
Jeff Matthews wrote: > > Is it possible for you, or anyone else, to send an e-mail to me, attaching > a sample SQLite database and some examples of simple uses of C# for searching, > relations, adds, changes. etc. Nothing fancy, please. Just minimal so it's > easy to follow. Or maybe, there

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

2011-12-13 Thread Jeff Matthews
Thanks, Joe, for that response. Is it possible for you, or anyone else, to send an e-mail to me, attaching a sample SQLite database and some examples of simple uses of C# for searching, relations, adds, changes. etc. Nothing fancy, please. Just minimal so it's easy to follow. Or maybe,

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

2011-12-13 Thread Joe Mistachkin
Jeff Matthews wrote: > > Does SQLite integrate with Vis. Studio with these same features available? > Currently, the CLR/VS integration for SQLite is primarily accomplished via System.Data.SQLite, please see: http://system.data.sqlite.org/ The Visual Studio design-time components are there as

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

2011-12-13 Thread Jeff Matthews
Hi, all. I am about sick and tired of the complexity of trying to deal with Server Express 2008 when I want to develop an app that simply uses a database in its most simple way. All I need to do is store my data and get it back in an efficient way. I like how C# can grab database models

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-13 Thread Simon Slavin
On 13 Dec 2011, at 11:04pm, Grace Batumbya wrote: > Since SQLite does not support stored procedures, what are some workarounds > that are used to accomplish things like executing a statement based on a > conditional. Triggers and programming languages. Simon.

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-13 Thread Igor Tandetnik
On 12/13/2011 6:38 PM, BareFeetWare wrote: If depends on what your statement 1 and statement 2 are. Let's say that they are update statements, then your above example would look something like: update tableX set column2 = 'match' where "column" = 'foo'; update tableX set column2 = 'no match'

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-13 Thread BareFeetWare
On 14/12/2011, at 10:04 AM, Grace Batumbya wrote: > Since SQLite does not support stored procedures, what are some workarounds > that are used to accomplish things like executing a statement based on a > conditional. > For example. > > IF value OF column IN tableX == 'foo' > DO statement 1 >

Re: [sqlite] Procedure (Conditional statement) workaround

2011-12-13 Thread Igor Tandetnik
On 12/13/2011 6:04 PM, Grace Batumbya wrote: Hey guys, Since SQLite does not support stored procedures, what are some workarounds that are used to accomplish things like executing a statement based on a conditional. For example. IF value OF column IN tableX == 'foo' DO statement 1 ELSE

[sqlite] Procedure (Conditional statement) workaround

2011-12-13 Thread Grace Batumbya
Hey guys, Since SQLite does not support stored procedures, what are some workarounds that are used to accomplish things like executing a statement based on a conditional. For example. IF value OF column IN tableX == 'foo' DO statement 1 ELSE statement 2 Thanks, -- *Grace Batumbya* Research

Re: [sqlite] Error: disk I/O error while creating an index

2011-12-13 Thread Simon Slavin
On 13 Dec 2011, at 8:10pm, Tal Tabakman wrote: > I discovered that the problem was not in the index creation but in the > database creation. > > it seems that during DB creation, a certain commit failed due to Disk > quota and after that indexing failed. I assume that SQLite did actually

[sqlite] Error: disk I/O error while creating an index

2011-12-13 Thread Tal Tabakman
Hi Dan, thanks for the tips. the strace tip did the trick. I discovered that the problem was not in the index creation but in the database creation. it seems that during DB creation, a certain commit failed due to Disk quota and after that indexing failed. strangely I don't understand this

Re: [sqlite] Need trigger

2011-12-13 Thread jwzumwalt
Thanks for the help! It turned out that the trigger was correct (and I also was using a default value). I am using SQLITE3 Managment Studio v3.7.9 and the default value was not being picked up during a insert using the IDE. For unknown reasons the trigger solves the problem. Thanks again for

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread Simon Slavin
On 13 Dec 2011, at 5:38pm, jr wrote: > since much of that time will be spent in the strftime() calls and > calculations, how about adding a lookup table with pre-computed date/times? Actually, with this much use of the date/time information I'd be storing it all as numbers. And if you're

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread jr
On 13/12/11 16:31, Rafael Garcia Leiva wrote: > > Yes, that works, even with missing data. The final query is: > > SELECT STRFTIME('%Y-%m-%d %H %M', MIN(date)) AS Date, > (SELECT open from eurusd e2 > where CAST(STRFTIME('%s', e2.date) AS INTEGER) >= > CAST(STRFTIME('%s', e1.date) AS INTEGER) /

Re: [sqlite] Foreign Key MATCH keyword

2011-12-13 Thread Richard Hipp
On Tue, Dec 13, 2011 at 12:23 PM, Pete wrote: > I may not have searched diligently enough but I can't find any information > about the purpose of the foreign key MATCH keyword. Is it documented > somewhere? > http://www.sqlite.org/search?q=foreign+key+match

[sqlite] Foreign Key MATCH keyword

2011-12-13 Thread Pete
I may not have searched diligently enough but I can't find any information about the purpose of the foreign key MATCH keyword. Is it documented somewhere? Thanks, -- Pete ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Need trigger

2011-12-13 Thread Simon Slavin
On 13 Dec 2011, at 3:55pm, jwzumwalt wrote: > I am attempting to crete a trigger that fills a field with "unknown" if a > update leaves it empty. I assume you know you can assign a default value for a column, so that this becomes the value of the column unless the INSERT sets it, or until an

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread Black, Michael (IS)
Possible causes. #1 You need indexes (quite possible) -- though it appears to me that all the casting is going to kill using indexes. #2 You need to increase cache (likely) -- try "pragam cache_size=200" #3 You're hitting swap space (doubtful) #4 You need to do this in your own code

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread Igor Tandetnik
On 12/13/2011 11:31 AM, Rafael Garcia Leiva wrote: The problem is that is very slow. It takes nearly 24 hours to query 1 year of Forex data in my laptop (and I have to work with 10 years periods). I will spend a couple of days learning about sqlite optimization. I suspect these two

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread Rafael Garcia Leiva
Yes, that works, even with missing data. The final query is: SELECT STRFTIME('%Y-%m-%d %H %M', MIN(date)) AS Date, (SELECT open from eurusd e2 where CAST(STRFTIME('%s', e2.date) AS INTEGER) >= CAST(STRFTIME('%s', e1.date) AS INTEGER) / (5 * 60) * 5 * 60 order by e2.date asc limit 1) AS Open,

Re: [sqlite] fossil 1.21: error while loading shared libraries: libssl.so.0.9.8

2011-12-13 Thread Richard Hipp
On Tue, Dec 13, 2011 at 11:03 AM, Richard Hipp wrote: > > > On Tue, Dec 13, 2011 at 10:50 AM, Bob Chapman wrote: > >> Under CentOS release 4.9 (Final) with the pre-built binary for >> fossil 1.21 I get the following: >> >> $ fossil version >> fossil:

Re: [sqlite] Need trigger

2011-12-13 Thread Black, Michael (IS)
Works for me CREATE TABLE employee(name text,editby text); CREATE TRIGGER update_editby AFTER INSERT ON employee BEGIN UPDATE employee SET editby = 'unknown' WHERE editby = '' AND rowid = new.rowid; END; INSERT INTO employee VALUES('Ralph',''); SELECT * FROM employee:

Re: [sqlite] fossil 1.21: error while loading shared libraries: libssl.so.0.9.8

2011-12-13 Thread Richard Hipp
On Tue, Dec 13, 2011 at 10:50 AM, Bob Chapman wrote: > Under CentOS release 4.9 (Final) with the pre-built binary for > fossil 1.21 I get the following: > > $ fossil version > fossil: error while loading shared libraries: libssl.so.0.9.8: . . . > > It seems that the

[sqlite] Need trigger

2011-12-13 Thread jwzumwalt
I am attempting to crete a trigger that fills a field with "unknown" if a update leaves it empty. the trigger I tried is shown below, but it does not seem to work. Any ideas what I am doing wrong? Thanks - JZ $query = "CREATE TRIGGER update_editby AFTER INSERT ON employee BEGIN

[sqlite] fossil 1.21: error while loading shared libraries: libssl.so.0.9.8

2011-12-13 Thread Bob Chapman
Under CentOS release 4.9 (Final) with the pre-built binary for fossil 1.21 I get the following: $ fossil version fossil: error while loading shared libraries: libssl.so.0.9.8: . . . It seems that the pre-built binary of fossil 1.21 requires: libssl.so.0.9.8 and libcrypto.so.0.9.8 while the

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread Rafael Garcia Leiva
El 12/12/2011 17:13, Igor Tandetnik escribió: On 12/12/2011 9:45 AM, Rafael Garcia Leiva wrote: Now I need the Open and the Close of the 5 minutes interval, where Open is the Open of the first minute of the interval, and Close is the Close of the last minute of the interval. Something like

Re: [sqlite] Aggregating Forex data

2011-12-13 Thread 雷钦
I think this can work SELECT STRFTIME('%Y-%m-%d %H %M', date) AS Date, (SELECT open from eurusd e2 where STRFTIME(e2.date) >= CAST(STRFTIME('%s', e1.date) / (5 * 60) AS INTEGER) * 5 * 60 order by e2.date asc limit 1) AS Open,

Re: [sqlite] Search optimization questions

2011-12-13 Thread Igor Tandetnik
Igor Tandetnik wrote: > But at one point, Mr. Hipp chimed in Sorry, it's Dr. Hipp. Shame on me. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Search optimization questions

2011-12-13 Thread Igor Tandetnik
Simon Slavin wrote: > 1) My index does not specifically involve ordering the entries in 'id' order. > But entries in the table are always entered > chronologically. Am I right that SQLite implicitly adds the rowid into every > index to keep entries unique ? Not so much

[sqlite] madIS v1.4 release

2011-12-13 Thread Eleytherios Stamatogiannakis
madIS is an extensible relational database system built upon the SQLite database and with extensions written in Python (via APSW SQLite wrapper). Its is developed at: http://madis.googlecode.com Due to madIS’ SQLite core, the database format of madIS is exactly the same as SQLite’s one. This

Re: [sqlite] Bash Scripting

2011-12-13 Thread eddy
On Mon, 12 Dec 2011, Alberto De La Torre wrote: Hello I have a problem scripting with sqlite3 If I use the same line inside a bash script like: TomaCampo=sqlite3 /Users/alberto/Documents/Casa/Domótica/Programas/cronizados/WeatherTracker/casa\ Database.sdb "select OutsideTemp from

[sqlite] Search optimization questions

2011-12-13 Thread Simon Slavin
This is simplified from what I'm really doing and I'm having to type this from memory, but I hope I've preserved enough that you can give the right answer. I keep a log of changes made. It looks like this: CREATE TABLE changes ( id INTEGER PRIMARY KEY, dateTime TEXT,