Re: [sqlite] Malformed database schema with SQLite version > 3.5.x

2008-03-20 Thread MarcoN
...oopss.. I supposed it was a fault of mine. Thanks for the support and the help. Just two points: 1. the "PRAGMA writable_schema=ON" is not described in the "official" documentation for the PRAGMA syntax 2. does this mean that if I create an invalid view in the database, the entire database

[sqlite] delete on view

2008-03-20 Thread Fabiano Sidler
Hi folks! After having UPDATE and INSERT on a view working, I'd also like to DELETE FROM a view. I have the following tables and a view: --- create table dbapp_tablenames ( tablenameID integer primary key, tablename text not null unique on conflict ignore ); create table

[sqlite] nested tree table porting from mysql -> sqlite

2008-03-20 Thread ciz
I have trouble to move up node on sqlite on mysql i write: UPDATE SET rgt = rgt + IF(rgt<%1,%2,-%3) on sqlite i must rewrite query to UPDATE SET rgt = (SELECT CASE WHEN (rgt < %1) THEN rgt + %2 ELSE rgt + -%3 END) is here a way to create a trigger or similar on sqlite to support IF(expression,int

Re: [sqlite] nested tree table porting from mysql -> sqlite

2008-03-20 Thread Igor Tandetnik
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have trouble to move up node on sqlite > on mysql i write: > UPDATE SET rgt = rgt + IF(rgt<%1,%2,-%3) > on sqlite i must rewrite query to > UPDATE SET rgt = (SELECT CASE WHEN (rgt < %1) THEN rgt + %2 ELSE rgt > + -%3 END) You don't

Re: [sqlite] delete on view

2008-03-20 Thread Igor Tandetnik
"Fabiano Sidler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > create trigger dbapp_delete instead of delete on dbapp begin > delete from dbapp_tablefields where tablenameID=( > select tablenameID from dbapp_tablenames > where tablename=old.tablename > and

Re: [sqlite] nested tree table porting from mysql -> sqlite

2008-03-20 Thread Dennis Cote
Igor Tandetnik wrote: > > You don't need SELECT keyword here. You could also get closer to the > original statement with > > UPDATE tableName SET rgt = rgt + (CASE WHEN (rgt < %1) THEN %2 ELSE -%3 > END); > This also has the advantage that it is standard SQL and therefore portable to many

[sqlite] List Issues

2008-03-20 Thread Mike Owens
Starting yesterday afternoon we seemed to experience some serious delays in mailing list distribution. It has been difficult to determine what the actual cause is, as there has been no configuration changes in either the mailing list of mail server. It *appears* as if this may have been a

[sqlite] Regular Expressions and sqlite3_create_function

2008-03-20 Thread Jason Tudor
I am trying to enable the REGEXP operator. I have read on the forums that you must use the sqlite3_create_function. I would like to use the boost regular expressions library under the hood. Question is, does anyone have an example using this function (sqlite3_create_function) to override

Re: [sqlite] Regular Expressions and sqlite3_create_function

2008-03-20 Thread Dennis Cote
Jason Tudor wrote: > I am trying to enable the REGEXP operator. I have read on the forums that > you must use the sqlite3_create_function. I would like to use the boost > regular expressions library under the hood. Question is, does anyone have > an example using this function

[sqlite] Major memory leak

2008-03-20 Thread Rob Richardson
Greetings! I must be doing something wrong. I've got a simple table with three columns, a key column, a value column and a timestamp column. There are 357,000 rows. The timestamps are stored as floating-point numbers (Julian dates), and the other two fields contain integers. I open the table,

[sqlite] New crashes with SQLite 3.5.7

2008-03-20 Thread Shawn Wilsher
Hey all, Mozilla has recently upgraded to sqlite 3.5.7, and we've suddenly gotten a lot of crashes. The mozilla bug report is here: https://bugzilla.mozilla.org/show_bug.cgi?id=424163 We haven't looked into it to much, but I figured I'd point it out to so you were aware of it. Cheers, Shawn

[sqlite] Major memory leak

2008-03-20 Thread Rob Richardson
Greetings! I must be doing something wrong. I've got a simple table with three columns, a key column, a value column and a timestamp column. There are 357,000 rows. The timestamps are stored as floating-point numbers (Julian dates), and the other two fields contain integers. I open the table,

Re: [sqlite] New crashes with SQLite 3.5.7

2008-03-20 Thread drh
"Shawn Wilsher" <[EMAIL PROTECTED]> wrote: > Hey all, > > Mozilla has recently upgraded to sqlite 3.5.7, and we've suddenly > gotten a lot of crashes. The mozilla bug report is here: > https://bugzilla.mozilla.org/show_bug.cgi?id=424163 > > We haven't looked into it to much, but I figured I'd

Re: [sqlite] New crashes with SQLite 3.5.7

2008-03-20 Thread Shawn Wilsher
> Any additional information you can send, such as the size of > the database file at the point of failure, or the exact line > on which the problem occurs, will be appreciated. (I know the > bug report gives a line-number, but line numbers shift from > one amalgamation to another, and I

Re: [sqlite] Regular Expressions and sqlite3_create_function

2008-03-20 Thread Dan
On Mar 20, 2008, at 10:38 PM, Jason Tudor wrote: > I am trying to enable the REGEXP operator. I have read on the > forums that > you must use the sqlite3_create_function. I would like to use the > boost > regular expressions library under the hood. Question is, does > anyone have > an

Re: [sqlite] Major memory leak

2008-03-20 Thread Ken
It might be helpful to include the version of sqlite. Have you run your code through a memory analysis routine such as valgrind, to validate that the leak is not occuring in your application code? HTH, Ken Rob Richardson <[EMAIL PROTECTED]> wrote: Greetings! I must be doing something wrong.

Re: [sqlite] Malformed database schema with SQLite version > 3.5.x

2008-03-20 Thread Kees Nuyt
On Thu, 20 Mar 2008 10:23:23 +0100, you wrote: >...oopss.. I supposed it was a fault of mine. >Thanks for the support and the help. > >Just two points: > >1. the "PRAGMA writable_schema=ON" is not described in >the "official" documentation for the PRAGMA syntax It's not a supported PRAGMA. In

Re: [sqlite] Malformed database schema with SQLite version > 3.5.x

2008-03-20 Thread drh
Kees Nuyt <[EMAIL PROTECTED]> wrote: > > >I know I can't create an invalid view, > >because SQLite refuses to create it, > >but this seems a problem to me... could SQLite just open the database, and > >complain only on the invalid views (i.e. for instance when I open the view > >to query the data

[sqlite] Why did 3.5.7 pass the following test in alter2

2008-03-20 Thread Noah Hart
do_test alter2-2.1 { execsql { CREATE TABLE abc2(a, b, c); INSERT INTO abc2 VALUES(1, 2, 10); INSERT INTO abc2 VALUES(3, 4, NULL); INSERT INTO abc2 VALUES(5, 6, NULL); CREATE VIEW abc2_v AS SELECT *

Re: [sqlite] Why did 3.5.7 pass the following test in alter2

2008-03-20 Thread Stephen Oberholtzer
> sqlite> CREATE TABLE abc2(a, b, c); > > sqlite> CREATE VIEW abc2_v AS SELECT * FROM abc2; > sqlite> SELECT * FROM abc2_v; > > sqlite> ALTER TABLE abc2 ADD COLUMN d; > > > I would expect the view to give 4 columns after the

[sqlite] SQL vs. MicroBlaze

2008-03-20 Thread Rob Birkner
Hello, I am trying to use SQLite on a MicroBlaze processor running uClinux using the petalogix toolchain. I can open an in-memory database, but when I try to open a file database the library can't open the file. Internally, the open call returns 22 - invalid argument. The application is

[sqlite] Use of two columns for a key and query on first clm.

2008-03-20 Thread Neville Franks
If I use two columns for a key (primary or separate index) and query just on the first column component will I always get back the first match in a set. For example. - create table mytable ( clm1 text collate nocase, clm2 text collate nocase, constraint mycs1 primary key( clm1, clm2 ) );

Re: [sqlite] Use of two columns for a key and query on first clm.

2008-03-20 Thread John Stanton
No, use ORDER BY Neville Franks wrote: > If I use two columns for a key (primary or separate index) and query > just on the first column component will I always get back the first > match in a set. For example. > > - > create table mytable ( clm1 text collate nocase, clm2 text collate

Re: [sqlite] Use of two columns for a key and query on first clm.

2008-03-20 Thread Neville Franks
Let me rephrase the question slightly. If I do select * from table where clm1='def'; then step through the results will I see all rows that include 'def'. The answer must be yes. The only issue is what order they will be in. If I want them ordered by clm2 then yes I'd probably need use ORDER

[sqlite] endless loop example

2008-03-20 Thread Derek Developer
In trying to break my code with the seinfeld database examples, I found this. SELECT f.name as food, e1.name, e1.season, e2.name, e2.season FROM episodes e1, foods_episodes fe1, foods f, episodes e2, foods_episodes fe2 Why does this put SQLite into an endless loop? (I am not using the shell tool,

Re: [sqlite] endless loop example

2008-03-20 Thread P Kishor
On 3/21/08, Derek Developer <[EMAIL PROTECTED]> wrote: > In trying to break my code with the seinfeld database examples, I found this. Derek, You are going to get much better help from the list, not to mention that you will probably get further with your "code breaking," if you provide some more