[sqlite] (shell dependent) library rounding error

2012-06-14 Thread Etienne
Hi Simon,

Thanks for your answer.

That said... the rounding error ITSELF is not the point.

The problem is: the "real" rounding error depends here on the shell (SQLite or 
JSDB) calling the SQLite library.

If I submit twice the same input (e.g. 0.1) to the same "black box" (e.g. 
SQLite library - same compiler options etc.), I am just waiting for the same 
(fake) result. IT was determinist... so far.

Why is SQLite able to "hide" the error in one case and not in the other case? 
Because they are slightly DIFFERENT! How is it possible? 

Regards,
Etienne



- Original message -
From: Simon Slavin 
To: General Discussion of SQLite Database 
Subject: Re: [sqlite] (shell dependent) library rounding error
Date: Thu, 14 Jun 2012 22:13:18 +0100


On 14 Jun 2012, at 9:30pm, Etienne  wrote:

> js>var db = new SQLite();
> js>db.exec("select 0.1", function(r){writeln(r)});
> 0.1=0.11
> true

There's no way to store the fraction 0.1 as a binary value.  Read this:



or go read any beginner's book on computer science.  SQLite, just like every 
other programming language, goes some way to fake its results but you can 
usually find some very simple operation which will make it expose the fact that 
it's all faked.  This isn't a bug in SQLite, it's a problem with pretending you 
can do the same things with binary and decimal numbers.

If you know you're going to need to store fractional values exactly, multiply 
all your numbers up until you can store integers.  For instance, if you need to 
store integer amounts of money precisely, multiply all the values by 100, store 
cents instead of Euros, and store them as INTEGER rather than REAL/FLOAT.

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


Re: [sqlite] Parameterized SQL

2012-06-14 Thread Igor Tandetnik

On 6/14/2012 5:16 PM, Udi Karni wrote:

Is there a way to run SQL scripts in the Shell with parameters?

Something like this?

set  = 2010

SELECT COUNT (*) FROM TABLE WHERE YEAR =  ;


Not to my knowledge.
--
Igor Tandetnik

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


[sqlite] Parameterized SQL

2012-06-14 Thread Udi Karni
Is there a way to run SQL scripts in the Shell with parameters?

Something like this?

set  = 2010

SELECT COUNT (*) FROM TABLE WHERE YEAR =  ;

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


Re: [sqlite] (shell dependent) library rounding error

2012-06-14 Thread Simon Slavin

On 14 Jun 2012, at 9:30pm, Etienne  wrote:

> js>var db = new SQLite();
> js>db.exec("select 0.1", function(r){writeln(r)});
> 0.1=0.11
> true

There's no way to store the fraction 0.1 as a binary value.  Read this:



or go read any beginner's book on computer science.  SQLite, just like every 
other programming language, goes some way to fake its results but you can 
usually find some very simple operation which will make it expose the fact that 
it's all faked.  This isn't a bug in SQLite, it's a problem with pretending you 
can do the same things with binary and decimal numbers.

If you know you're going to need to store fractional values exactly, multiply 
all your numbers up until you can store integers.  For instance, if you need to 
store integer amounts of money precisely, multiply all the values by 100, store 
cents instead of Euros, and store them as INTEGER rather than REAL/FLOAT.

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


Re: [sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Richard Hipp
On Thu, Jun 14, 2012 at 4:13 PM, Sergei G  wrote:

> Is there a way I can obtain documentation that matches my version?
> Online documentation is for the most current version.
> I have found that both my hosting provider and debian stable are a bit
> behind, so I have to work with what I've got.
>


http://www.sqlite.org/sqlite_docs_3_7_3.zip

-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Kevin Benson
On Thu, Jun 14, 2012 at 4:27 PM, Kees Nuyt  wrote:

> On Thu, 14 Jun 2012 13:13:58 -0700, Sergei G 
> wrote:
>
> >Is there a way I can obtain documentation that matches my version?
> >Online documentation is for the most current version.
> >I have found that both my hosting provider and debian stable are a bit
> >behind, so I have to work with what I've got.
> >
> >
> >Thanks
>
> Part of the documentation is partly generated from the sqlite source
> code maintained in the fossil [1] source repository.
> The remainder is kept in a separate source repository.
>
>
> You can check out any point on the timelines of both repositories.
>
> Links are at the bottom of :
> http://www.sqlite.org/download.html
>
>
> [1] http://www.fossil-scm.org/
>
> --
> Regards,
>
> Kees Nuyt
>


 And, of course, there's also the Internet Archive:

http://wayback.archive.org/web/*/http://www.sqlite.org

--
   --
  --
 --Ô¿Ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (shell dependent) library rounding error

2012-06-14 Thread Etienne
Hi all,

This is not really a SQLite issue, but the only solution I found out so far 
consists in modifying SQLite sources.

Maybe someone here is able to clarify the following mystery... 

---
SQLite shell output:

R:\>sqlite NUL "select 0.1;"
0.1


JSDB (www.jsdb.org) output:

js>var db = new SQLite();
js>db.exec("select 0.1", function(r){writeln(r)});
0.1=0.11
true
---

[Same rounding error with a couple of other "short" reals]

AFAIK, JSDB does use the SQLite library properly.

Technically, I can not figure out why sqlite3:sqlite3VXPrintf() behaves 
differently if embedded in the SQLite shell or in JSDB.

In this particular case, "realvalue" values start to diverge slightly from the 
"10.0" loop:

---
if( realvalue>0.0 ){
  while( realvalue>=1e32 && exp<=350 ){ realvalue *= 1e-32; exp+=32; }
  while( realvalue>=1e8 && exp<=350 ){ realvalue *= 1e-8; exp+=8; }
  
  while( realvalue>=10.0 && exp<=350 ){ realvalue *= 0.1; exp++; }  <--
  
  while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; }
  while( realvalue<1.0 ){ realvalue *= 10.0; exp--; }
---

Adding intermediate exp power(s) of 2 (between 8 and 1) in the lines above does 
fix the problem, e.g.:

(...)
if( realvalue>=1e4 && exp<=350 ){ realvalue *= 1e-4; exp+=4; }
(...)

However I still do not know why the same code/input/compiler options etc. lead 
to slightly different results.

Any hint welcome!

Thanks in advance.

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


Re: [sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Kees Nuyt
On Thu, 14 Jun 2012 13:13:58 -0700, Sergei G 
wrote:

>Is there a way I can obtain documentation that matches my version?
>Online documentation is for the most current version.
>I have found that both my hosting provider and debian stable are a bit
>behind, so I have to work with what I've got.
>
>
>Thanks

Part of the documentation is partly generated from the sqlite source
code maintained in the fossil [1] source repository.
The remainder is kept in a separate source repository.


You can check out any point on the timelines of both repositories.

Links are at the bottom of :
http://www.sqlite.org/download.html 


[1] http://www.fossil-scm.org/

-- 
Regards,

Kees Nuyt

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Philip Bennefall
The main issue I have is that the Apache license, as well as the gpl/lgpl 
licenses, force you to include the entire license with any redistribution of 
the software (even if it is compiled as part of a derivative work) if my 
understanding is correct. I am not too keen on doing that. I certainly don't 
mind giving credit where credit is due, but I don't want to include this huge 
blob of legal text. This is why I like public domain software so much, as well 
as software distributed under licenses such as the Boost Software license, the 
Zlib/Libpng license and one or two others that are similar.

Kind regards,

Philip Bennefall
  - Original Message - 
  From: Black, Michael (IS) 
  To: phi...@blastbay.com 
  Sent: Thursday, June 14, 2012 9:34 PM
  Subject: Re: [sqlite] Full text search without full phrase matches


  Apache license is about as liberal as you can get.  Damned near public domain 
(may as well be for all intents and purposes).



  Muy I ask what the problem is?  Perhaps something I should aware of?





  Michael D. Black

  Senior Scientist

  Advanced Analytics Directorate

  Advanced GEOINT Solutions Operating Unit

  Northrop Grumman Information Systems


--

  From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Philip Bennefall [phi...@blastbay.com]
  Sent: Thursday, June 14, 2012 2:09 PM
  To: General Discussion of SQLite Database
  Subject: EXT :Re: [sqlite] Full text search without full phrase matches


  Hi Michael,

  That seems to be under either gpl/lgpl/apache licenses, which I cannot use in 
my project for various reasons. The reason I am so interested in SqLite is 
because it's public domain. I appreciate the tip though.

  Kind regards,

  Philip Bennefall
- Original Message - 
From: Black, Michael (IS) 
To: phi...@blastbay.com ; General Discussion of SQLite Database 
Sent: Thursday, June 14, 2012 9:03 PM
Subject: Re: [sqlite] Full text search without full phrase matches


Sounds to me like you want Lucene instead of SQLite

http://lucene.apache.org/core/



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


  --

From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Philip Bennefall [phi...@blastbay.com]
Sent: Thursday, June 14, 2012 1:32 PM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Full text search without full phrase matches


Hi Simon,

The ordering is not really the issue I am having. That, I can do if I just 
get a result back that doesn't necessarily match all the keywords. In the 
query you showed as an example, all the keywords would still have to match 
in order for a row to be returned. The sorting is a separate problem that 
is 
not really that difficult once I get a smaller dataset. Then I can order it 
manually. The problem is that it only returns a match if every single word 
is present. I would like it to return matches if, say, mor than 2 or 3 of 
the specified keywords are found.

Kind regards,

Philip Bennefall
- Original Message - 
From: "Simon Slavin" 
To: "General Discussion of SQLite Database" 
Sent: Thursday, June 14, 2012 8:24 PM
Subject: Re: [sqlite] Full text search without full phrase matches



On 14 Jun 2012, at 7:13pm, Philip Bennefall  wrote:

> That is unfortunate, if it is true that there's no way to accomplish this 
> with SqLite. To do just plain matching I can use an unordered hash map, 
so 
> I wouldn't need a database for that. The trouble with a string distance 
> function is that I can't really process the entire dataset with it. 
SqLite 
> technically has all the features I'm after, I just don't want it to 
> necessarily match all the words in a query. If I can get it to match all 
> as well as some, that would be enough. I could then do distancing on a 
> considerably smaller dataset which would be the result of the broader 
> SqLite search.
>
> So I guess my main question is, is there absolutely no way to match a 
> subset of the words in a query?

Well, you could write that string distance function and add it to your copy 
of SQLite as an external function.  Then you could do things like

SELECT string_distance(theText, 'this new piece of text'), theText FROM 
oldChats WHERE string_distance(theText, 'this new piece of text') < 10 
ORDER 
BY string_distance(theText, 'this new piece of text')

(I don't know whether SQLite will optimise that to avoid executing the same 
function many times, or whether 

Re: [sqlite] count() problem.

2012-06-14 Thread Duquette, William H (318K)

On 6/14/12 1:00 PM, "Igor Tandetnik"  wrote:

>On 6/14/2012 2:00 PM, Duquette, William H (318K) wrote:
>> What I want to do is find a_id's for which c contains no rows with the
>>matching b_id in which the flag column is 1.
>
>Why don't you just say that?
>
>select a_id from a
>where b_id not in (select b_id from c where flag = 1);

I tend not to think in terms of nested selects.  That looks very nice!

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

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


Re: [sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Sergei G
Is there a way I can obtain documentation that matches my version?
Online documentation is for the most current version.
I have found that both my hosting provider and debian stable are a bit
behind, so I have to work with what I've got.


Thanks

On Thu, Jun 14, 2012 at 1:16 AM, Dan Kennedy  wrote:

> On 06/14/2012 01:27 PM, Sergei G wrote:
>
>> I am running sqlite3 version 3.7.3 on debian.
>>
>> I run the following commands from fts3.html documentation page:
>>
>> CREATE VIRTUAL TABLE t1 USING fts4(a, b);
>> INSERT INTO t1 VALUES('transaction default models default', 'Non
>> transaction reads');
>> INSERT INTO t1 VALUES('the default transaction', 'these semantics
>> present');
>> INSERT INTO t1 VALUES('single request', 'default data');
>>
>> SELECT matchinfo(t1) FROM t1 WHERE t1 MATCH 'default transaction
>> "these semantics"';
>>
>> SELECT matchinfo(t1, 'ns') FROM t1 WHERE t1 MATCH 'default transaction';
>>
>> The last line with match info(t1, 'ns') fails with the following error
>> message:
>>
>> Error: wrong number of arguments to function matchinfo()
>>
>> I have originally worked on my own table, but found the same error. So, I
>> have tried example above and it failed for me in the same way.
>>
>
> I think the two argument version of matchinfo() is only in 3.7.4 and
> newer. Prior to that it only accepted one argument.
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] count() problem.

2012-06-14 Thread Igor Tandetnik

On 6/14/2012 2:00 PM, Duquette, William H (318K) wrote:

What I want to do is find a_id's for which c contains no rows with the matching 
b_id in which the flag column is 1.


Why don't you just say that?

select a_id from a
where b_id not in (select b_id from c where flag = 1);

--
Igor Tandetnik

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Philip Bennefall
Hi Michael,

That seems to be under either gpl/lgpl/apache licenses, which I cannot use in 
my project for various reasons. The reason I am so interested in SqLite is 
because it's public domain. I appreciate the tip though.

Kind regards,

Philip Bennefall
  - Original Message - 
  From: Black, Michael (IS) 
  To: phi...@blastbay.com ; General Discussion of SQLite Database 
  Sent: Thursday, June 14, 2012 9:03 PM
  Subject: Re: [sqlite] Full text search without full phrase matches


  Sounds to me like you want Lucene instead of SQLite

  http://lucene.apache.org/core/



  Michael D. Black

  Senior Scientist

  Advanced Analytics Directorate

  Advanced GEOINT Solutions Operating Unit

  Northrop Grumman Information Systems


--

  From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Philip Bennefall [phi...@blastbay.com]
  Sent: Thursday, June 14, 2012 1:32 PM
  To: General Discussion of SQLite Database
  Subject: EXT :Re: [sqlite] Full text search without full phrase matches


  Hi Simon,

  The ordering is not really the issue I am having. That, I can do if I just 
  get a result back that doesn't necessarily match all the keywords. In the 
  query you showed as an example, all the keywords would still have to match 
  in order for a row to be returned. The sorting is a separate problem that is 
  not really that difficult once I get a smaller dataset. Then I can order it 
  manually. The problem is that it only returns a match if every single word 
  is present. I would like it to return matches if, say, mor than 2 or 3 of 
  the specified keywords are found.

  Kind regards,

  Philip Bennefall
  - Original Message - 
  From: "Simon Slavin" 
  To: "General Discussion of SQLite Database" 
  Sent: Thursday, June 14, 2012 8:24 PM
  Subject: Re: [sqlite] Full text search without full phrase matches



  On 14 Jun 2012, at 7:13pm, Philip Bennefall  wrote:

  > That is unfortunate, if it is true that there's no way to accomplish this 
  > with SqLite. To do just plain matching I can use an unordered hash map, so 
  > I wouldn't need a database for that. The trouble with a string distance 
  > function is that I can't really process the entire dataset with it. SqLite 
  > technically has all the features I'm after, I just don't want it to 
  > necessarily match all the words in a query. If I can get it to match all 
  > as well as some, that would be enough. I could then do distancing on a 
  > considerably smaller dataset which would be the result of the broader 
  > SqLite search.
  >
  > So I guess my main question is, is there absolutely no way to match a 
  > subset of the words in a query?

  Well, you could write that string distance function and add it to your copy 
  of SQLite as an external function.  Then you could do things like

  SELECT string_distance(theText, 'this new piece of text'), theText FROM 
  oldChats WHERE string_distance(theText, 'this new piece of text') < 10 ORDER 
  BY string_distance(theText, 'this new piece of text')

  (I don't know whether SQLite will optimise that to avoid executing the same 
  function many times, or whether you can name a column and use that name to 
  do the same thing yourself.)

  Here's the documentation for external functions:

  

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

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Black, Michael (IS)
Sounds to me like you want Lucene instead of SQLite

http://lucene.apache.org/core/



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Philip Bennefall [phi...@blastbay.com]
Sent: Thursday, June 14, 2012 1:32 PM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Full text search without full phrase matches

Hi Simon,

The ordering is not really the issue I am having. That, I can do if I just
get a result back that doesn't necessarily match all the keywords. In the
query you showed as an example, all the keywords would still have to match
in order for a row to be returned. The sorting is a separate problem that is
not really that difficult once I get a smaller dataset. Then I can order it
manually. The problem is that it only returns a match if every single word
is present. I would like it to return matches if, say, mor than 2 or 3 of
the specified keywords are found.

Kind regards,

Philip Bennefall
- Original Message -
From: "Simon Slavin" 
To: "General Discussion of SQLite Database" 
Sent: Thursday, June 14, 2012 8:24 PM
Subject: Re: [sqlite] Full text search without full phrase matches



On 14 Jun 2012, at 7:13pm, Philip Bennefall  wrote:

> That is unfortunate, if it is true that there's no way to accomplish this
> with SqLite. To do just plain matching I can use an unordered hash map, so
> I wouldn't need a database for that. The trouble with a string distance
> function is that I can't really process the entire dataset with it. SqLite
> technically has all the features I'm after, I just don't want it to
> necessarily match all the words in a query. If I can get it to match all
> as well as some, that would be enough. I could then do distancing on a
> considerably smaller dataset which would be the result of the broader
> SqLite search.
>
> So I guess my main question is, is there absolutely no way to match a
> subset of the words in a query?

Well, you could write that string distance function and add it to your copy
of SQLite as an external function.  Then you could do things like

SELECT string_distance(theText, 'this new piece of text'), theText FROM
oldChats WHERE string_distance(theText, 'this new piece of text') < 10 ORDER
BY string_distance(theText, 'this new piece of text')

(I don't know whether SQLite will optimise that to avoid executing the same
function many times, or whether you can name a column and use that name to
do the same thing yourself.)

Here's the documentation for external functions:



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

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Simon Slavin

On 14 Jun 2012, at 7:32pm, Philip Bennefall  wrote:

> The problem is that it only returns a match if every single word is present. 
> I would like it to return matches if, say, mor than 2 or 3 of the specified 
> keywords are found.

As far as I can figure, you need to write that function yourself.  Either as a 
SQLite function to build into SQLite, or in whatever programming language you 
want to use.  Sorry.

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Philip Bennefall

Hi Simon,

The ordering is not really the issue I am having. That, I can do if I just 
get a result back that doesn't necessarily match all the keywords. In the 
query you showed as an example, all the keywords would still have to match 
in order for a row to be returned. The sorting is a separate problem that is 
not really that difficult once I get a smaller dataset. Then I can order it 
manually. The problem is that it only returns a match if every single word 
is present. I would like it to return matches if, say, mor than 2 or 3 of 
the specified keywords are found.


Kind regards,

Philip Bennefall
- Original Message - 
From: "Simon Slavin" 

To: "General Discussion of SQLite Database" 
Sent: Thursday, June 14, 2012 8:24 PM
Subject: Re: [sqlite] Full text search without full phrase matches



On 14 Jun 2012, at 7:13pm, Philip Bennefall  wrote:

That is unfortunate, if it is true that there's no way to accomplish this 
with SqLite. To do just plain matching I can use an unordered hash map, so 
I wouldn't need a database for that. The trouble with a string distance 
function is that I can't really process the entire dataset with it. SqLite 
technically has all the features I'm after, I just don't want it to 
necessarily match all the words in a query. If I can get it to match all 
as well as some, that would be enough. I could then do distancing on a 
considerably smaller dataset which would be the result of the broader 
SqLite search.


So I guess my main question is, is there absolutely no way to match a 
subset of the words in a query?


Well, you could write that string distance function and add it to your copy 
of SQLite as an external function.  Then you could do things like


SELECT string_distance(theText, 'this new piece of text'), theText FROM 
oldChats WHERE string_distance(theText, 'this new piece of text') < 10 ORDER 
BY string_distance(theText, 'this new piece of text')


(I don't know whether SQLite will optimise that to avoid executing the same 
function many times, or whether you can name a column and use that name to 
do the same thing yourself.)


Here's the documentation for external functions:



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


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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Simon Slavin

On 14 Jun 2012, at 7:13pm, Philip Bennefall  wrote:

> That is unfortunate, if it is true that there's no way to accomplish this 
> with SqLite. To do just plain matching I can use an unordered hash map, so I 
> wouldn't need a database for that. The trouble with a string distance 
> function is that I can't really process the entire dataset with it. SqLite 
> technically has all the features I'm after, I just don't want it to 
> necessarily match all the words in a query. If I can get it to match all as 
> well as some, that would be enough. I could then do distancing on a 
> considerably smaller dataset which would be the result of the broader SqLite 
> search.
> 
> So I guess my main question is, is there absolutely no way to match a subset 
> of the words in a query?

Well, you could write that string distance function and add it to your copy of 
SQLite as an external function.  Then you could do things like

SELECT string_distance(theText, 'this new piece of text'), theText FROM 
oldChats WHERE string_distance(theText, 'this new piece of text') < 10 ORDER BY 
string_distance(theText, 'this new piece of text')

(I don't know whether SQLite will optimise that to avoid executing the same 
function many times, or whether you can name a column and use that name to do 
the same thing yourself.)

Here's the documentation for external functions:



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


Re: [sqlite] count() problem.

2012-06-14 Thread Duquette, William H (318K)
On 6/14/12 11:06 AM, "Pavel Ivanov"  wrote:


>> SELECT a_id, count(*)
>> FROM a LEFT OUTER JOIN c USING (b_id)
>> WHERE c.flag = 1
>> GROUP BY a_id
>>
>> I get a positive count if there are there are matching rows with flag =
>>1; but if an a_id has no matching rows in c with flag=1, I get nothing
>>at all.  What I want is a row with the a_id and a count of 0.
>
>To achieve that you should do the following:
>
>SELECT a_id, count(*)
>FROM a LEFT OUTER JOIN c ON a.b_id = c.b_id AND c.flag = 1
>GROUP BY a_id
>
>
>Pavel

I had to do this:

SELECT a_id, count(num)
FROM a LEFT OUTER JOIN c ON a.b_id = c.b_id AND c.flag = 1
GROUP BY a_id

With "count(*)" it's counting the rows with a non-null a_id.  With
"count(num)", it's counting the rows with a non-null "num", which is what
I want.


Thanks, this was extremely helpful!

Will

>
>
>On Thu, Jun 14, 2012 at 2:00 PM, Duquette, William H (318K)
> wrote:
>> I have a database with two tables, one of which depends on the other:
>>
>> CREATE TABLE a(
>>  a_id INTEGER PRIMARY KEY
>>  b_id INTEGER);
>>
>> CREATE TABLE c(
>>  b_id INTEGER,
>>  num INTEGER,
>>  flag INTEGER,
>>  PRIMARY KEY (b_id,num));
>>
>> In words, each "a" is associated with a "b", and the "b" has any number
>>of "c"'s associated it with.  (There's also a "b" table, which I've
>>omitted.)
>>
>> Table c might not have any rows for a specific b_id.  In the rows it
>>has, the flag column might be 0 or 1.
>>
>> What I want to do is find a_id's for which c contains no rows with the
>>matching b_id in which the flag column is 1.  I'm using a query like
>>this:
>>
>> SELECT a_id, count(*)
>> FROM a LEFT OUTER JOIN c USING (b_id)
>> WHERE c.flag = 1
>> GROUP BY a_id
>>
>> I get a positive count if there are there are matching rows with flag =
>>1; but if an a_id has no matching rows in c with flag=1, I get nothing
>>at all.  What I want is a row with the a_id and a count of 0.
>>
>> What am I doing wrong?  Is there an easy way to do this?
>>
>> Thanks!
>>
>> --
>> Will Duquette -- william.h.duque...@jpl.nasa.gov
>> Athena Development Lead -- Jet Propulsion Laboratory
>> "It's amazing what you can do with the right tools."
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Philip Bennefall

Hi Simon,

That is unfortunate, if it is true that there's no way to accomplish this 
with SqLite. To do just plain matching I can use an unordered hash map, so I 
wouldn't need a database for that. The trouble with a string distance 
function is that I can't really process the entire dataset with it. SqLite 
technically has all the features I'm after, I just don't want it to 
necessarily match all the words in a query. If I can get it to match all as 
well as some, that would be enough. I could then do distancing on a 
considerably smaller dataset which would be the result of the broader SqLite 
search.


So I guess my main question is, is there absolutely no way to match a subset 
of the words in a query?


Kind regards,

Philip Bennefall
- Original Message - 
From: "Simon Slavin" 

To: "General Discussion of SQLite Database" 
Sent: Thursday, June 14, 2012 7:24 PM
Subject: Re: [sqlite] Full text search without full phrase matches



On 14 Jun 2012, at 6:12pm, Philip Bennefall  wrote:

The trouble I have is that in my query, all the keywords don't necessarily 
have to be present in order for a successful match to be made. SqLite's 
fts only seems to match if all the keywords are present, which I don't 
require.


You will have to do some of this in your own programming.  In fact you may 
end up doing all of it in your own programming and using the FTS feature 
only to match single words and single word-fragments.


The usual way to do this is to define a 'distance' metric for comparing two 
strings and finding how far apart they are.  A score of 0 means they match 
exactly.  Numbers bigger than a certain amount don't matter: anything bigger 
than, say, 100 means they're not at all alike.


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

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


Re: [sqlite] count() problem.

2012-06-14 Thread Pavel Ivanov
> SELECT a_id, count(*)
> FROM a LEFT OUTER JOIN c USING (b_id)
> WHERE c.flag = 1
> GROUP BY a_id
>
> I get a positive count if there are there are matching rows with flag = 1; 
> but if an a_id has no matching rows in c with flag=1, I get nothing at all.  
> What I want is a row with the a_id and a count of 0.

To achieve that you should do the following:

SELECT a_id, count(*)
FROM a LEFT OUTER JOIN c ON a.b_id = c.b_id AND c.flag = 1
GROUP BY a_id


Pavel


On Thu, Jun 14, 2012 at 2:00 PM, Duquette, William H (318K)
 wrote:
> I have a database with two tables, one of which depends on the other:
>
>     CREATE TABLE a(
>          a_id INTEGER PRIMARY KEY
>          b_id INTEGER);
>
>     CREATE TABLE c(
>          b_id INTEGER,
>          num INTEGER,
>          flag INTEGER,
>          PRIMARY KEY (b_id,num));
>
> In words, each "a" is associated with a "b", and the "b" has any number of 
> "c"'s associated it with.  (There's also a "b" table, which I've omitted.)
>
> Table c might not have any rows for a specific b_id.  In the rows it has, the 
> flag column might be 0 or 1.
>
> What I want to do is find a_id's for which c contains no rows with the 
> matching b_id in which the flag column is 1.  I'm using a query like this:
>
> SELECT a_id, count(*)
> FROM a LEFT OUTER JOIN c USING (b_id)
> WHERE c.flag = 1
> GROUP BY a_id
>
> I get a positive count if there are there are matching rows with flag = 1; 
> but if an a_id has no matching rows in c with flag=1, I get nothing at all.  
> What I want is a row with the a_id and a count of 0.
>
> What am I doing wrong?  Is there an easy way to do this?
>
> Thanks!
>
> --
> Will Duquette -- william.h.duque...@jpl.nasa.gov
> Athena Development Lead -- Jet Propulsion Laboratory
> "It's amazing what you can do with the right tools."
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] count() problem.

2012-06-14 Thread Duquette, William H (318K)
I have a database with two tables, one of which depends on the other:

 CREATE TABLE a(
  a_id INTEGER PRIMARY KEY
  b_id INTEGER);

 CREATE TABLE c(
  b_id INTEGER,
  num INTEGER,
  flag INTEGER,
  PRIMARY KEY (b_id,num));

In words, each "a" is associated with a "b", and the "b" has any number of 
"c"'s associated it with.  (There's also a "b" table, which I've omitted.)

Table c might not have any rows for a specific b_id.  In the rows it has, the 
flag column might be 0 or 1.

What I want to do is find a_id's for which c contains no rows with the matching 
b_id in which the flag column is 1.  I'm using a query like this:

SELECT a_id, count(*)
FROM a LEFT OUTER JOIN c USING (b_id)
WHERE c.flag = 1
GROUP BY a_id

I get a positive count if there are there are matching rows with flag = 1; but 
if an a_id has no matching rows in c with flag=1, I get nothing at all.  What I 
want is a row with the a_id and a count of 0.

What am I doing wrong?  Is there an easy way to do this?

Thanks!

--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Simon Slavin

On 14 Jun 2012, at 6:12pm, Philip Bennefall  wrote:

> The trouble I have is that in my query, all the keywords don't necessarily 
> have to be present in order for a successful match to be made. SqLite's fts 
> only seems to match if all the keywords are present, which I don't require.

You will have to do some of this in your own programming.  In fact you may end 
up doing all of it in your own programming and using the FTS feature only to 
match single words and single word-fragments.

The usual way to do this is to define a 'distance' metric for comparing two 
strings and finding how far apart they are.  A score of 0 means they match 
exactly.  Numbers bigger than a certain amount don't matter: anything bigger 
than, say, 100 means they're not at all alike.

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


Re: [sqlite] Full text search without full phrase matches

2012-06-14 Thread Philip Bennefall

Hi Paul, and thank you for your reply.

The trouble I have is that in my query, all the keywords don't necessarily 
have to be present in order for a successful match to be made. SqLite's fts 
only seems to match if all the keywords are present, which I don't require.


I am not familiar with Perl, but am working exclusively in C++.

The input I am processing is arbitrary, and so is the data that I am 
searching through in the index. The incoming data is user messages, and the 
index contains old messages that the robot has given to users (stemmed and 
stripped in various ways to make matches more probable), and then there's 
another column which contains an appropriate answer if that query is 
matched. I want it to match as many keywords as possible but not necessarily 
all, and order by:
1. How many keywords were matched, with some minimum threshold below which 
no match is made.

2. How well the ordering matched.

Do you have any tips?

Kind regards,

Philip Bennefall
- Original Message - 
From: 

To: 
Sent: Thursday, June 14, 2012 7:01 PM
Subject: [sqlite] Full text search without full phrase matches


I had to implement something like this for comparing passages from statutes 
(see the Introduction in Douglas Hay and Paul Craven, *Masters, Servants and 
Magistrates in Britain and the Empire, 1562-1955* [UNCP Press, 2004] for an 
illustration).


You need to isolate the keywords, in whatever order, count them, and measure 
the distances (number of words) between them.  SqLite is great for managing 
the tables of keywords, the lists of texts that contain them, and tables of 
distances.  But it is not the optimal tool for breaking down the texts and 
extracting the keywords and distances.  I used Perl for this job, and found 
that I could easily adapt recipes from the Perl Cookbook and similar 
repositories to build my routines.  I wrote the disaggregated lists of 
keywords, distances and texts as sql tables and analysed them in SqLite.


Paul Craven
York University

--

Date: Wed, 13 Jun 2012 23:09:35 +0200
From: Philip Bennefall 
To: 
Subject: [sqlite] Full text search without full phrase matches
Message-ID: 
Content-Type: text/plain; charset="iso-8859-1"

Hi all,

I am new to this maling list and to SqLite, so I wanted to start by thanking 
all of those who make this project a reality. It is a great tool.


Now, to my question. I am trying to use the full text search feature to find 
rough matches for a chat robot. Basically I want to match as many keywords 
as possible, but not necessarily all of them. The results should be sorted 
based on how many keywords were found in the phrase and how closely ordered 
they are to the query. In other words the ordering doesn't have to be exact, 
but the closer it is, the higher the result should rank. Similarly, even if 
only one or two words in the phrase are found it should match, but rank 
higher the more of the words that are present. I have read the reference and 
I see the NEAR statement and the matchinfo function, as well as the example 
of how to use it, but I cannot figure out how to apply this knowledge to my 
specific problem. Does anyone have any suggestions?


Thanks in advance for your help.

Kind regards,

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


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


[sqlite] Full text search without full phrase matches

2012-06-14 Thread pcarb
I had to implement something like this for comparing passages from statutes 
(see the Introduction in Douglas Hay and Paul Craven, *Masters, Servants and 
Magistrates in Britain and the Empire, 1562-1955* [UNCP Press, 2004] for an 
illustration).

You need to isolate the keywords, in whatever order, count them, and measure 
the distances (number of words) between them.  SqLite is great for managing the 
tables of keywords, the lists of texts that contain them, and tables of 
distances.  But it is not the optimal tool for breaking down the texts and 
extracting the keywords and distances.  I used Perl for this job, and found 
that I could easily adapt recipes from the Perl Cookbook and similar 
repositories to build my routines.  I wrote the disaggregated lists of 
keywords, distances and texts as sql tables and analysed them in SqLite.

Paul Craven
York University

--

Date: Wed, 13 Jun 2012 23:09:35 +0200
From: Philip Bennefall 
To: 
Subject: [sqlite] Full text search without full phrase matches
Message-ID: 
Content-Type: text/plain; charset="iso-8859-1"

Hi all,

I am new to this maling list and to SqLite, so I wanted to start by thanking 
all of those who make this project a reality. It is a great tool.

Now, to my question. I am trying to use the full text search feature to find 
rough matches for a chat robot. Basically I want to match as many keywords as 
possible, but not necessarily all of them. The results should be sorted based 
on how many keywords were found in the phrase and how closely ordered they are 
to the query. In other words the ordering doesn't have to be exact, but the 
closer it is, the higher the result should rank. Similarly, even if only one or 
two words in the phrase are found it should match, but rank higher the more of 
the words that are present. I have read the reference and I see the NEAR 
statement and the matchinfo function, as well as the example of how to use it, 
but I cannot figure out how to apply this knowledge to my specific problem. 
Does anyone have any suggestions?

Thanks in advance for your help.

Kind regards,

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


[sqlite] Full text search without full phrase matches

2012-06-14 Thread pcarb
I had to implement something like this for comparing passages from statutes 
(see the Introduction in Douglas Hay and Paul Craven, *Masters, Servants and 
Magistrates in Britain and the Empire, 1562-1955* [UNCP Press, 2004] for an 
illustration).

You need to isolate the keywords, in whatever order, count them, and measure 
the distances (number of words) between them.  SqLite is great for managing the 
tables of keywords, the lists of texts that contain them, and tables of 
distances.  But it is not the optimal tool for breaking down the texts and 
extracting the keywords and distances.  I used Perl for this job, and found 
that I could easily adapt recipes from the Perl Cookbook and similar 
repositories to build my routines.  I wrote the disaggregated lists of 
keywords, distances and texts as sql tables and analysed them in SqLite.

Paul Craven
York University

--

Date: Wed, 13 Jun 2012 23:09:35 +0200
From: Philip Bennefall 
To: 
Subject: [sqlite] Full text search without full phrase matches
Message-ID: 
Content-Type: text/plain; charset="iso-8859-1"

Hi all,

I am new to this maling list and to SqLite, so I wanted to start by thanking 
all of those who make this project a reality. It is a great tool.

Now, to my question. I am trying to use the full text search feature to find 
rough matches for a chat robot. Basically I want to match as many keywords as 
possible, but not necessarily all of them. The results should be sorted based 
on how many keywords were found in the phrase and how closely ordered they are 
to the query. In other words the ordering doesn't have to be exact, but the 
closer it is, the higher the result should rank. Similarly, even if only one or 
two words in the phrase are found it should match, but rank higher the more of 
the words that are present. I have read the reference and I see the NEAR 
statement and the matchinfo function, as well as the example of how to use it, 
but I cannot figure out how to apply this knowledge to my specific problem. 
Does anyone have any suggestions?

Thanks in advance for your help.

Kind regards,

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


Re: [sqlite] Incremental SQLite synchronization

2012-06-14 Thread Simon Slavin

On 13 Jun 2012, at 8:43pm, Dima Bodrov  wrote:

> I’m considering SQLite for a multi-device mobile application. Is there
> anything in SQLite that allows a database on a mobile device to be synced
> with the master database in the cloud incrementally? Looks like iOS can do
> this through Core Data API. I imaging they're moving some kind of
> “transaction” or “update” log back and forth bidirectionally.

Yes, iOS (and the Mac OS if you want to write a Mac client too) has an API 
which allows you to code up whatever change you made and send it to the cloud, 
which then pushes that change to all your devices.  It's a fully documented 
API.  One disadvantage is that, of course, your devices have to all be 
connected to the internet before they can send or receive changes.  The other 
disadvantage is that as far as I know there's no client for anything Apple 
didn't make, so if you want to write an Android version of your App, it can't 
use the same mechanism.

> Is such
> transaction log functionality built into SQLite?

No.  And there's no way to implement it in a 'standard' way, because different 
programmers would need it to work differently.  Theres no way of solving the 
problem which would be useful for all SQLite users.  So don't expect it to 
appear.

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


[sqlite] Incremental SQLite synchronization

2012-06-14 Thread Dima Bodrov
I’m considering SQLite for a multi-device mobile application. Is there
anything in SQLite that allows a database on a mobile device to be synced
with the master database in the cloud incrementally? Looks like iOS can do
this through Core Data API. I imaging they're moving some kind of
“transaction” or “update” log back and forth bidirectionally. Is such
transaction log functionality built into SQLite? If not, is this something
that’s being planned for future releases of SQLite or is already being
worked on? Thanks, Dima

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


[sqlite] ANN: SQLite Data Wizard 12.6 released

2012-06-14 Thread SQL Maestro Group

Hi!

SQL Maestro Group announces the release of SQLite Data Wizard 12.6, a 
powerful Windows GUI solution for SQLite data management.


The new version is immediately available at
http://www.sqlmaestro.com/products/sqlite/datawizard/

SQLite Data Wizard provides you with a number of easy-to-use wizards to 
convert any ADO-compatible database to the SQLite database, import data into 
SQLite tables, export data from tables, views and queries to most popular 
file formats as well as generate data-driven ASP.NET pages for your SQLite 
database.


Top 10 new features
=

1. The SQL Dump wizard. This tool allows you to export the data from 
selected tables and views as a set of INSERT statements.


2. Data Pump: User-defined data type mappings.

3. Data Pump: Recognizing autoincrement columns in the source database and 
converting them in the best possible way.


4. Data Pump: Data import using bulk-loading commands.

5. Data Import: Auto arranging target tables by dependencies.

6. Data Import: Import data from CSV files that contain multi-line strings.

7. Data Export: Decimal and thousand separators for the generated files 
(when applicable).


8. All tools: Correct exit status (0 on success, 1 on error) for the 
command-line mode. This return code can be checked in batch files using the 
ERRORLEVEL variable.


9. All tools: Progress windows are redesigned in the modern style and become 
more informative.


10. All tools: Log files become more structured and detailed.

In addition to this, several bugs have been fixed and some other minor 
improvements and corrections have been made. Full press-release is available 
at:

http://www.sqlmaestro.com/news/company/data_wizards_12_6_released/

Background information:
---
SQL Maestro Group offers complete database admin, development and management 
tools for MySQL, SQL Server, PostgreSQL, Oracle, DB2, SQLite, SQL Anywhere, 
Firebird and MaxDB providing the highest performance, scalability and 
reliability to meet the requirements of today's database applications.


Sincerely yours,
The SQL Maestro Group Team
http://www.sqlmaestro.com

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


Re: [sqlite] Queries on SQLite

2012-06-14 Thread Richard Hipp
On Thu, Jun 14, 2012 at 2:41 AM, vallur raghava reddy <
vallur.raghavare...@gmail.com> wrote:

> Hi,
> I have few queries on SQLite. I have listed them below, please go
> through them and answer.
>
>   1. Is SQLite POSIX compliant?
>

I'm not sure what this question is asking.  SQLite works on POSIX systems.
It uses only POSIX interfaces on those systems.  What does it mean for an
ANSI-C code library to be "POSIX compliant"?

SQLite also runs on Windows, OS/2, SymbianOS, QNX, and a host of other
non-POSIX systems.  Does that make it non-POSIX compliant?


>   2. Does SQLite create a any threads? If YES, how many will be created?
>

SQLite does not create threads.


>
> Previously I have sent few questions and the response was really good. I
> really appreciate that. Please reply the same for above questions.
>
> Thanks
>
> Raghava Reddy
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Dan Kennedy

On 06/14/2012 01:27 PM, Sergei G wrote:

I am running sqlite3 version 3.7.3 on debian.

I run the following commands from fts3.html documentation page:

CREATE VIRTUAL TABLE t1 USING fts4(a, b);
INSERT INTO t1 VALUES('transaction default models default', 'Non
transaction reads');
INSERT INTO t1 VALUES('the default transaction', 'these semantics present');
INSERT INTO t1 VALUES('single request', 'default data');

SELECT matchinfo(t1) FROM t1 WHERE t1 MATCH 'default transaction
"these semantics"';

SELECT matchinfo(t1, 'ns') FROM t1 WHERE t1 MATCH 'default transaction';

The last line with match info(t1, 'ns') fails with the following error
message:

Error: wrong number of arguments to function matchinfo()

I have originally worked on my own table, but found the same error. So, I
have tried example above and it failed for me in the same way.


I think the two argument version of matchinfo() is only in 3.7.4 and
newer. Prior to that it only accepted one argument.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite sessions: handling rollbacks

2012-06-14 Thread Marco Bambini
Can you post some code or more details?
Sessions has been specifically developed to handle rollbacks so your issue 
sounds really strange to me.

--
Marco Bambini
http://www.sqlabs.com








On Jun 13, 2012, at 8:57 PM, Charles Samuels wrote:

> 
> I'm using sqlite's sessions module, and I'm noticing that it doesn't appear 
> to 
> handle rollbacks.
> 
> Specifically, if I'm recording a database, and then I rollback the database, 
> the session module appears to still record the changes made by that rollback. 
> 
> Why does this apparently significant flaw exists this module? Is there an 
> easy 
> to way solve it?
> 
> Charles
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


[sqlite] Queries on SQLite

2012-06-14 Thread vallur raghava reddy
Hi,
 I have few queries on SQLite. I have listed them below, please go
through them and answer.

   1. Is SQLite POSIX compliant?
   2. Does SQLite create a any threads? If YES, how many will be created?

Previously I have sent few questions and the response was really good. I
really appreciate that. Please reply the same for above questions.

Thanks

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


[sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Sergei G
I am running sqlite3 version 3.7.3 on debian.

I run the following commands from fts3.html documentation page:

CREATE VIRTUAL TABLE t1 USING fts4(a, b);
INSERT INTO t1 VALUES('transaction default models default', 'Non
transaction reads');
INSERT INTO t1 VALUES('the default transaction', 'these semantics present');
INSERT INTO t1 VALUES('single request', 'default data');

SELECT matchinfo(t1) FROM t1 WHERE t1 MATCH 'default transaction
"these semantics"';

SELECT matchinfo(t1, 'ns') FROM t1 WHERE t1 MATCH 'default transaction';

The last line with match info(t1, 'ns') fails with the following error
message:

Error: wrong number of arguments to function matchinfo()

I have originally worked on my own table, but found the same error. So, I
have tried example above and it failed for me in the same way.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users