[sqlite] compile sqlite with Visual Studio 6

2010-07-07 Thread Andrea Galeazzi
How can I compile sqlite with Visual Studio 6 with an equivalent option of /fp:precise? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] sqlite3IsNaN with msvc6

2010-06-29 Thread Andrea Galeazzi
MSVC6 doesn't have /fp: option so this piece of code in main.c always yields an assert: if ( rc==SQLITE_OK ){ u64 x = (((u64)1)<<63)-1; double y; assert(sizeof(x)==8); assert(sizeof(x)==sizeof(y)); memcpy(&y, &x, 8); assert( sqlite3IsNaN(y) ); } How can I compile sqlite

[sqlite] check constraint error message

2010-06-01 Thread Andrea Galeazzi
Is it possible to have a custom check constraint error message? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] join performance query

2010-05-11 Thread Andrea Galeazzi
d_song = MYPLAYLISTSONGS.id_song > > > ) as SONGIDLIST > > on SONG.id_song = SONGIDLIST.id_song > > > Regards > Tim Romano > > > > > > > On Tue, May 11, 2010 at 6:07 AM, Andrea Galeazzi wrote: > >> Hi guys, >> I'm in a bind for a h

[sqlite] join performance query

2010-05-11 Thread Andrea Galeazzi
Hi guys, I'm in a bind for a huge time consuming query! I made the following database schema: CREATE TABLE Song ( idINTEGER NOT NULL UNIQUE, titleVARCHAR(40) NOT NULL DEFAULT '' COLLATE NOCASE, artistVARCHAR(40) NOT NULL DEFAULT '' CO

[sqlite] find same type

2010-05-11 Thread Andrea Galeazzi
I've got this table TABLE T ( idINTEGER NOT NULL UNIQUE, file_typeVARCHAR(10) NOT NULL) My goal is to check if a certain selection has all the same values. I thought that the following statement should be enough for my aim: SELECT (SELECT file_type FROM T T1,

Re: [sqlite] Expression tree is too large

2010-05-05 Thread Andrea Galeazzi
Thanks, it works! Frank Baumgart ha scritto: >> - Ursprüngliche Nachricht - >> Von: Andrea Galeazzi >> Gesendet: 05.05.10 12:14 Uhr >> An: General Discussion of SQLite Database >> Betreff: [sqlite] Expression tree is too large >> >> > Hi g

[sqlite] Expression tree is too large

2010-05-05 Thread Andrea Galeazzi
Hi guys, I've got a DELETE statement with a lot of OR: DELETE FROM myTable WHERE id = ? OR id = ?..OR id=? and SQLite throws this error: Expression tree is too large. Do you know a way to avoid such problem or I just have to split the large statement into shorter ones? Cheers ___

[sqlite] changing check constraints

2010-04-29 Thread Andrea Galeazzi
Is it possible to change check constraints? Regards ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] if exist

2010-03-09 Thread Andrea Galeazzi
It works fine! Thanks! Martin.Engelschalk ha scritto: > Hi, > > try this: > > select coalesce(min(length), 0) from t where id = ? > > Martin > > Andrea Galeazzi schrieb: > >> Hi All, >> I've got a table T made up of only two fields: INT i

[sqlite] if exist

2010-03-09 Thread Andrea Galeazzi
Hi All, I've got a table T made up of only two fields: INT id (PRIMARY KEY) and INT length. I need a statement in order to yield 0 when the key doesn't exist. At this moment the query is too simple: SELECT length FROM T WHERE id = ? Any idea about it? Cheers __

Re: [sqlite] UPDATE the order of INT fileds

2009-12-22 Thread Andrea Galeazzi
Simon Slavin ha scritto: > On 22 Dec 2009, at 10:25am, Andrea Galeazzi wrote: > > >> ID INTEGER, >> Name TEXT >> >> So, for instance, I can have: >> >> 1 Julia >> 2 Eric >> 3 Kevin >> 4 Sarah >> 5 John >> >> N

[sqlite] UPDATE the order of INT fileds

2009-12-22 Thread Andrea Galeazzi
Hi, I'm trying to solve this problem: I've got the following table, made up of two fields: ID INTEGER, Name TEXT So, for instance, I can have: 1 Julia 2 Eric 3 Kevin 4 Sarah 5 John Now I wanna move Eric from 2 to 4 in order to yield (by performing a series of UPDATE of ID field): 1 Julia

[sqlite] open transaction

2009-11-27 Thread galeazzi
How could I know if a transaction is already open? Does a specific command exist? Cheers ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] collation bug?

2009-11-12 Thread galeazzi
Sorry, I forgot to say that this method is just defined as static: static int xCompare (void* v, int iLen1, const void* str1, int iLen2, const void* str2); In my opinion the important question is: does the return value have a specific meaning according with its numeric value or returning posit

[sqlite] collation bug?

2009-11-12 Thread galeazzi
Hi everybody, I found a strange behaviour of SQLite (3.6.19) when it relies on a custom collation during a SELECT execution. So let me explain the matter from the beginning: I've got the following simple table: CREATE TABLE Genre ( idINTEGER NOT NULL UNIQUE, name

[sqlite] any keyword

2009-11-11 Thread Andrea Galeazzi
Probably sqlite doesn't support 'any' keyword as I write it in the following query: SELECT G.id,name FROM Genre G WHERE G.id = ANY (SELECT S.genre_id FROM Song S) ORDER BY name ASC; In this case I can write an equivalent query like: select G.id,name from Genre G WHERE (SELECT COUNT(*) FROM Song

Re: [sqlite] SQLITE_CORRUPT error

2009-06-24 Thread Andrea Galeazzi
So I'm gonna find this fix in the 3.6.16 version right? I'd like to avoid to download it directly from cvs... D. Richard Hipp ha scritto: > On Jun 23, 2009, at 3:16 AM, Andrea Galeazzi wrote: > > >> Any news about this problem? >> > > http://w

Re: [sqlite] SQLITE_CORRUPT error

2009-06-23 Thread Andrea Galeazzi
Any news about this problem? galea...@korg.it ha scritto: In order to be more confidence about what I'm saying, I downloaded the precompiled sqlite console 3.6.15 (windows version), I executed the statement above and I've got the following error: sqlite3.exe malformed_db.db SQLite version 3.

Re: [sqlite] SQLITE_CORRUPT error

2009-06-19 Thread galeazzi
Citando "D. Richard Hipp" : > > On Jun 18, 2009, at 12:36 PM, galea...@korg.it wrote: > >> This statement is giving me truoble: >> INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES >> (5235, 9, 256) > > That INSERT statement works fine for me. > > Did you try recompiling with opt

Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread galeazzi
This statement is giving me truoble: INSERT INTO PlayList_Song(id_song, id_playlist, song_number) VALUES (5235, 9, 256) Citando "D. Richard Hipp" : > > On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote: > >> I updated sqlite version from 3.6.14 to 15, now when I try to run a >> C++ code to fil

Re: [sqlite] SQLITE_CORRUPT error

2009-06-18 Thread galeazzi
I run "PRAGMA integrity_check" using version 3.6.14 at the end of the code and it executed a query with only one row "ok", so where do I have to send the databbase? Thanks Citando "D. Richard Hipp" : > > On Jun 18, 2009, at 9:04 AM, galea...@korg.it wrote: > >> I updated sqlite version from 3

[sqlite] SQLITE_CORRUPT error

2009-06-18 Thread galeazzi
I updated sqlite version from 3.6.14 to 15, now when I try to run a C++ code to fill the database I have SQLITE_CORRUPT error. This error happens in the accessPayload method (btree.c) in the condition if( rc==SQLITE_OK && amt>0 ){ return SQLITE_CORRUPT_BKPT; } where rc is SQLITE_OK but amt

[sqlite] defrag a numeric field

2009-06-12 Thread galeazzi
Hi, I've got an int column containing a numeric sequence like 1,5,6,8,10... how can I perform an update in order to have 1,2,3,4,5? Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] select performance with join

2009-05-08 Thread galeazzi
Citando Igor Tandetnik : > Andrea Galeazzi wrote: >> but when I execute: >> >> SELECT S.id,title,artist,bpm,name >> >> FROM Song AS S >> >> LEFT JOIN Genre AS G ON (S.genre_id = G.id) >> >> WHERE name<= 'zUmM' AND (na

[sqlite] select performance with join

2009-05-07 Thread Andrea Galeazzi
Hi guys, I've got a big problem about select performance on an left join. I have two tables: CREATE TABLE Song ( id INTEGER NOT NULL UNIQUE, title VARCHAR(40) NULL COLLATE NOCASE, artist VARCHAR(40) NULL COLLATE NOCASE, bpm INT NULL, genre_id INT NULL, PRIMARY KEY (id), CONSTRAINT fk_Genr

[sqlite] index optimization

2009-04-20 Thread galeazzi
Hi, if I've got a lot of queries as follows: SELECT id,title FROM Song WHERE title >= 'last_title' AND (title>'last_title' OR id>last_id) ORDER BY title ASC, id ASC what's the best index should be created? (id is the key); I red that I can only use a multicolumn index if the left condition is e

Re: [sqlite] using wstring

2009-04-16 Thread galeazzi
I cannot use parameterized queries because the queries are more complex than the simple one that I wrote, furthermore I've to use sqlite3_get_table Citando Igor Tandetnik : > wrote in message > news:20090416124428.h5zi6xji5h5wk...@webmail.korg.it >> I'm currently working with a framework whic

Re: [sqlite] using wstring

2009-04-16 Thread galeazzi
I cannot use parameterized queries because the queries are more complex than the simple one that I wrote, I've sqlite3_get_table Citando Igor Tandetnik : > wrote in message > news:20090416124428.h5zi6xji5h5wk...@webmail.korg.it >> I'm currently working with a framework which uses wstring, how

[sqlite] using wstring

2009-04-16 Thread galeazzi
I'm currently working with a framework which uses wstring, how can I dynamically create queries like this: std::wstring sQuery = L”SELECT * FROM Table WHERE Tilte = '”; sQuery += title; //it's a wstring sQuery += “'” I tried to use (const char*)sQuery.c_str() but it doesn't work. Any ideas? ___

Re: [sqlite] Index optimization

2009-03-17 Thread Andrea Galeazzi
ORDER BY title,id; ? Furthermore can the index improve select performance in both previous cases? Igor Tandetnik ha scritto: > "Andrea Galeazzi" wrote in > message news:49bf6196.5070...@korg.it > >> Is the order of WHERE clauses important as C-language is? >> >

Re: [sqlite] Index optimization

2009-03-17 Thread Andrea Galeazzi
((title=:last_title AND id>:last_id) > > ?Anyway, can the index improve select performance in both previous cases? > > Igor Tandetnik ha scritto: > >> "Andrea Galeazzi" wrote in >> message news:49be74fd.6060...@korg.it >> >>

Re: [sqlite] Index optimization

2009-03-17 Thread Andrea Galeazzi
y, can the index improve select performance in both previous cases? Igor Tandetnik ha scritto: > "Andrea Galeazzi" wrote in > message news:49be74fd.6060...@korg.it > >> I red this article on wiki: >> http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor >> I&

Re: [sqlite] Index optimization

2009-03-16 Thread Andrea Galeazzi
Andrea Galeazzi ha scritto: > I red this article on wiki: > http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor > I've got a similar case but the difference is that I've to use LIKE > operator instead of = > SELECT title FROM tracks > WHERE title LIKE %Mad%

[sqlite] Index optimization

2009-03-16 Thread Andrea Galeazzi
I red this article on wiki: http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor I've got a similar case but the difference is that I've to use LIKE operator instead of = SELECT title FROM tracks WHERE title LIKE %Mad% AND ((title=:last_title AND id>:last_id) OR ((title>:last_title)) O

Re: [sqlite] get_table and bind

2009-03-11 Thread galeazzi
Citando Igor Tandetnik : > galea...@korg.it wrote: >> is it possible to use a similar function to get_table but starting by >> a statement in order to use the bind facilities? > > Anything wrong with calling sqlite3_step in a loop? > > Igor Tandetnik > > > > ___

[sqlite] get_table and bind

2009-03-10 Thread galeazzi
is it possible to use a similar function to get_table but starting by a statement in order to use the bind facilities? Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] nullable select fields

2009-03-10 Thread galeazzi
Citando John Machin : > On 10/03/2009 10:56 PM, Andrea Galeazzi wrote: >> Hi All, >> I'm developing an application which relies on sqllite as back-end. Now >> I face to this problem: I've got a form that allows the user to fill a >> lot of fields, oblivi

[sqlite] nullable select fields

2009-03-10 Thread Andrea Galeazzi
Hi All, I'm developing an application which relies on sqllite as back-end. Now I face to this problem: I've got a form that allows the user to fill a lot of fields, obliviously only a little part of them will actually be filled, the others isn't gonna be in the search criteria. So I prepare a