Re: [sqlite] queries for a fulltext-engine

2009-05-24 Thread Emil Obermayr
On Sun, May 24, 2009 at 02:28:36PM +0200, Lukas Haase wrote:
> 
> SELECT topic_fulltext.topicID
> FROM fulltext
> JOIN topic_fulltext ON topic_fulltext.fulltextID = fulltext.fulltextID
> WHERE (word LIKE 'Word1%') AND (word LIKE 'Word2%');

Obviously this must be empty because a string can't start with "Word1"
and start with "Word2" at the same time.

Maybe you should try % on both ends of the search string.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Emil Obermayr
On Tue, May 19, 2009 at 02:06:37PM +0200, Jean-Denis Muys wrote:
> 
> There exists unique natural numbers q and r such as:
> 
> a = b*q+r
> 0 <= r < b
> 
> q is defined as the quotient, r is defined as the remainder.
> 
> So if the % operator wants to match that math definition, its results should
> never be negative. In the example given, (-1)%7 should therefore be 6.

It depends wether you focus on a arithmetic meaning of the remainder or
on what you call "mathematics" (what would be "Restklasse" in german, I
don't know the english term).

In terms of "Restklasse" you want a positive modulo and get a negative
division result.

In terms of arithmetics you want a positive division result and get a
negative modulo.

Both are valid solutions. At the end you have to live with the
definition of the given implementation.

Just check the sign and correct the sign of the result according to your
needs.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Emil Obermayr
On Thu, Apr 02, 2009 at 08:20:38PM -0700, Dave Brown wrote:
> Our software often runs into problems when run on USB keys. Specifically,
> calls to sqlite to read/write to the database hang infinitely, or return

Does it work on harddisk?

I can tell RO-access works nicely on Windows XP.

Do you have those timeouts only with some request; or does it happen
even with very simple ones like select * from smalltable; ?

I can tell sqlite takes a very long time with unbracketed joins. The
performance is way better with brackets around each join.

Do you have more than one process connected to the file at a time? Maybe
they are blocking each other.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Emil Obermayr
On Fri, Apr 03, 2009 at 12:25:18PM +0200, Sylvain Pointeau wrote:
> 
> How do I specify the character "line feed" (\n)
> in my query?

Depends a little on your wrapper (outer) programming language.

A technic that works in most language is to fill a variable with the
code of LF and then use this variable to concatenate the string. Even
the \n stuff should work in many languages. 

Tell us your coding language to get more specific hints.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Does anybody have a working version of php_sqlite3.dll?

2009-03-04 Thread Emil Obermayr
On Wed, Mar 04, 2009 at 09:05:34AM +0100, ZeWaren / Erwan Martin wrote:
> 
> A few days ago I had to migrate my project from linux to windows. It is
> using the php sqlite3 extension, to access sqlite3 database files.

Use the "external" version of the PDO-sqlite and use the normal DLL from
the sqlite-homepage. Put it in the normal PHP-directory, parallel to the
php-DLLs like php5isapi.dll.

That works for me.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] ambiguous columns with natural join

2009-01-22 Thread Emil Obermayr
On Wed, Jan 21, 2009 at 01:37:39PM +0100, Emil Obermayr wrote:
> I am not sure what the standard says, but I am used to single columns
> after a natural join. So if table a and b are joined through column c
> the following statement is valid:
> 
> select c from a natural join b;

bad example, because actually it works with 2 tables

is does not with 3 tables without brackets:

sqlite> select x from a natural join b natural join c;
SQL error: ambiguous column name: x

same with brackets:

sqlite> select x from a natural join (b natural join c);
1
2

Might be related to Ticket 1217; I added a remark there. 
I guess this is still a little fault in the parser?

Emil
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] ambiguous columns with natural join

2009-01-21 Thread Emil Obermayr
On Wed, Jan 21, 2009 at 07:40:53AM -0500, Igor Tandetnik wrote:
> 
> Can you just write "select a.c from a natural join b;" ?

Of course, but the DB-application is already written and is used by
other DBs also. The application design currently needs the column to be
unique without the need to specify the table.

According to all the descriptions and documentations I can access, the
table-qualifier of a natural-join column is not needed and sometimes
even considered a syntax error. 

What is the statement of the sqlite-developers about that topic?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] ambiguous columns with natural join

2009-01-21 Thread Emil Obermayr
I am not sure what the standard says, but I am used to single columns
after a natural join. So if table a and b are joined through column c
the following statement is valid:

select c from a natural join b;

But I get "SQL error: ambiguous column name: c"

Can this behaviour be changed? Will it be changed in the future?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] newbie question regarding my sqlite code

2009-01-10 Thread Emil Obermayr
Am Samstag, 10. Januar 2009 schrieb silvio grosso:

> The query is:
> select avg(age), avg(durata), sum(età) from acoda, main, dipendenti

This is "cross join" over all three tables. The result is a "monster table", 
consisting of every possible combination of the records of those three 
tables. And in this "monster table" the sum most probably is correct.

Please read your SQL-documention about different types of joins and what they 
are good for.

For debugging purposes you can have a look at 

  select *  from acoda, main, dipendenti

to see the raw result of your join.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bool Values

2009-01-09 Thread Emil Obermayr
Is there a way to use bool-values to make migration from other DB easier?

e.g.

select * from address where local = true

like defining true as a contant that represents a numeric 1?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] update PHP

2009-01-09 Thread Emil Obermayr
Am Donnerstag, 8. Januar 2009 schrieb Kees Nuyt:

> Note: With Apache, the easiest location for sqlite3.dll is
> the .../apache/bin directory. php_pdo will find it there.
> Perhaps the same goes for lighttpd.

It works with sqlite3.dll in die PHP-directory.

Thanks for that information. Everything works nicely now.

nobs
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] update PHP

2009-01-08 Thread Emil Obermayr
Hello list,

I run a Windows XP system and want to "fill" the sqlite-DB through a
ODBC-connection with data from other databases and then use it on a
independant server (lighttp on USB-stick).

The sqlite-version I get as ODBC-driver works nicely.

The sqlite-version I get included in PHP as well.

But both say "this is not a database" when I try to use the file of the one
with the other.

I guess it is because PHP is shipped with sqlite-version 3.3.7.

How do I update the PDO-driver of PHP?

Thanks for help

nobs
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users