[sqlite] (no subject)

2012-06-15 Thread Bageesh.M.Bose
Any one please tell me How to use triggers in sqlite using C... -- With Regards, *Bageesh.M.Bose* ** ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Triggers in Sqlite using C

2012-06-15 Thread Bageesh.M.Bose
Can anyone tell How to use Triggers in Sqlite using C -- With Regards, *Bageesh.M.Bose* ** ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Parameterized SQL

2012-06-15 Thread Niall O'Reilly
On 14 Jun 2012, at 22:16, Udi Karni wrote: Is there a way to run SQL scripts in the Shell with parameters? Something like this? set YEAR = 2010 SELECT COUNT (*) FROM TABLE WHERE YEAR = YEAR ; ??? I use bash and sqlite3, as in the fragment below. #!/bin/bash # query-script

Re: [sqlite] Parameterized SQL

2012-06-15 Thread Udi Karni
Niall - thanks. If I understand correctly - you use bash to do the preprocessing of the substitutions and submit the prepared statements to Sqlite. On Fri, Jun 15, 2012 at 1:48 AM, Niall O'Reilly niall.orei...@ucd.iewrote: On 14 Jun 2012, at 22:16, Udi Karni wrote: Is there a way to run SQL

[sqlite] Porter Stemmer

2012-06-15 Thread Philip Bennefall
Hi all, Is the algorithm used in the stemming tokenizer in SqLite's fts extension equivalent to the C implementation found at http://tartarus.org/~martin/PorterStemmer/ ? I am asking this because some sources say that there are improved versions of this algorithm released much later than

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Christian Smith
On Fri, Jun 15, 2012 at 11:59:33AM +0530, Bageesh.M.Bose wrote: Can anyone tell How to use Triggers in Sqlite using C Triggers in SQLite can only contain SQL DML statements. But, you can interface with C by defining functions, then calling those functions using SQL SELECT command. For

[sqlite] order by clause should come after union not before

2012-06-15 Thread YAN HONG YE
select * from hbc order by cmc desc limit 10 union select * from hbc where qph0 union select * from hbc where hctl=1 this sql cmd cause the error: order by clause should come after union not before ___ sqlite-users mailing list

Re: [sqlite] Queries on SQLite

2012-06-15 Thread Christian Smith
On Thu, Jun 14, 2012 at 06:27:17AM -0400, Richard Hipp wrote: On Thu, Jun 14, 2012 at 2:41 AM, vallur raghava reddy vallur.raghavare...@gmail.com wrote: 2. Does SQLite create a any threads? If YES, how many will be created? SQLite does not create threads. Except when the

Re: [sqlite] Parameterized SQL

2012-06-15 Thread Niall O'Reilly
On 15 Jun 2012, at 10:45, Udi Karni wrote: Niall - thanks. If I understand correctly - you use bash to do the preprocessing of the substitutions and submit the prepared statements to Sqlite. Well, 'prepared' is not the term I would use, as it has a specific meaning in the

Re: [sqlite] Announcement: DRH to be in Munich, Germany July 3rd, 2012

2012-06-15 Thread Stephan Beal
Hi, all! Final reminder! Please get in touch soon if you wish to partake. We still have plenty of slots free... @Those who have gotten in touch: i will send you the exact address and whatnot within the next two weeks. The timeframe is not yet set, but i expect it will be more or less a full-day

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Richard Hipp
On Fri, Jun 15, 2012 at 5:51 AM, Philip Bennefall phi...@blastbay.comwrote: Hi all, Is the algorithm used in the stemming tokenizer in SqLite's fts extension equivalent to the C implementation found at http://tartarus.org/~martin/PorterStemmer/ The built-in Porter stemmer is a copy/paste

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Philip Bennefall
Thanks, Richard. That's good to know because I am trying to decide whether to add a new tokenizer with some custom processing, as opposed to using the built in stemmer. Kind regards, Philip Bennefall - Original Message - From: Richard Hipp To: phi...@blastbay.com ; General

Re: [sqlite] order by clause should come after union not before

2012-06-15 Thread Simon Slavin
On 15 Jun 2012, at 10:56am, YAN HONG YE yanhong...@mpsa.com wrote: select * from hbc order by cmc desc limit 10 union select * from hbc where qph0 union select * from hbc where hctl=1 this sql cmd cause the error: order by clause should come after union not before Yes. The UNION

Re: [sqlite] order by clause should come after union not before

2012-06-15 Thread Kevin Benson
On Fri, Jun 15, 2012 at 5:56 AM, YAN HONG YE yanhong...@mpsa.com wrote: select * from hbc order by cmc desc limit 10 union select * from hbc where qph0 union select * from hbc where hctl=1 this sql cmd cause the error: order by clause should come after union not before

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Black, Michael (IS)
Could the SQLite code add a new dummy function for a callback which we can then override with our own library? That would provide an easy-to-use interface which would then still work in the shell (unless you're doing some other database functions inside the callback -- coider beware). e.g.

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

2012-06-15 Thread Simon Slavin
On 15 Jun 2012, at 5:32am, Etienne ejlist-sql...@yahoo.fr wrote: 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. Yes. Different languages use different ways to hide the

Re: [sqlite] Parameterized SQL

2012-06-15 Thread Don V Nielsen
I use Ruby. In the following example I use a replacement tag #{lvl} in the scripts. For each of the levels (indv,hhld,resi), I do a substitution against the script and pass the script to sqlite. dbname = File.join('d:','cloveretl','projects','test_ii','data-out-97','test.db') db =

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Jay A. Kreibich
On Fri, Jun 15, 2012 at 12:12:22PM +, Black, Michael (IS) scratched on the wall: Could the SQLite code add a new dummy function for a callback which we can then override with our own library? Just use an SQL function: http://sqlite.org/c3ref/create_function.html -j -- Jay A.

Re: [sqlite] order by clause should come after union not before

2012-06-15 Thread Jay A. Kreibich
On Fri, Jun 15, 2012 at 08:10:20AM -0400, Kevin Benson scratched on the wall: On Fri, Jun 15, 2012 at 5:56 AM, YAN HONG YE yanhong...@mpsa.com wrote: select * from hbc order by cmc desc limit 10 union select * from hbc where qph0 union select * from hbc where hctl=1 this sql cmd

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Black, Michael (IS)
But as somebody pointed out if you muck with database from the shell or any other program it will die with function not found if the trigger is called. Ergo a dummy function to make it happy and non-fatal. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Philip Bennefall
I had another quick question. If I have built an fts table using the stemmer tokenizer, and then I later decide that I want to change to the simple one, is there an easy way to do this? I see the rebuild command, can I somehow tell that to change the tokenizer as well? I see the reference to

Re: [sqlite] order by clause should come after union not before

2012-06-15 Thread Igor Tandetnik
YAN HONG YE yanhong...@mpsa.com wrote: select * from hbc order by cmc desc limit 10 union select * from hbc where qph0 union select * from hbc where hctl=1 this sql cmd cause the error: order by clause should come after union not before select * from hbc where rowid in (select rowid

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Richard Hipp
On Fri, Jun 15, 2012 at 9:00 AM, Philip Bennefall phi...@blastbay.comwrote: I had another quick question. If I have built an fts table using the stemmer tokenizer, and then I later decide that I want to change to the simple one, is there an easy way to do this? I see the rebuild command, can

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Igor Tandetnik
Black, Michael (IS) michael.bla...@ngc.com wrote: Could the SQLite code add a new dummy function for a callback which we can then override with our own library? sqlite3_update_hook -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Igor Tandetnik
Bageesh.M.Bose bageesh...@gmail.com wrote: Can anyone tell How to use Triggers in Sqlite using C What do you mean by use triggers, exactly? What are you trying to achieve? If you are asking how to create a trigger, then it's the same way as creating a table - you open a database connection

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Philip Bennefall
I understand that, but let's say that I already have a virtual fts table created that I set to use the Porter tokenizer, how then would I go about rebuilding and retokenizing this table with the simple tokenizer at a later time? Would I need to create an entirely new table? What I'm wondering

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Black, Michael (IS)
Looks like that is getting close...but when is this called? BEFORE or AFTER? And you also wouldn't know which trigger got calledonly which table was touched. The dummy function would solve both those problems. So I can still see an sqlite3_callback() either overloaded or a function

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Richard Hipp
On Fri, Jun 15, 2012 at 9:26 AM, Philip Bennefall phi...@blastbay.comwrote: I understand that, but let's say that I already have a virtual fts table created that I set to use the Porter tokenizer, how then would I go about rebuilding and retokenizing this table with the simple tokenizer at a

Re: [sqlite] Porter Stemmer

2012-06-15 Thread Philip Bennefall
Understood. Thank you very much for your quick help. Now I have all the information I need to get coding. And thanks once again for a great library! Kind regards, Philip Bennefall - Original Message - From: Richard Hipp To: phi...@blastbay.com ; General Discussion of SQLite

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Igor Tandetnik
Black, Michael (IS) michael.bla...@ngc.com wrote: Looks like that is getting close...but when is this called? BEFORE or AFTER? After, as far as I can tell. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Triggers in Sqlite using C

2012-06-15 Thread Jay A. Kreibich
On Fri, Jun 15, 2012 at 12:42:45PM +, Black, Michael (IS) scratched on the wall: But as somebody pointed out if you muck with database from the shell or any other program it will die with function not found if the trigger is called. Ergo a dummy function to make it happy and non-fatal.

Re: [sqlite] Queries on SQLite

2012-06-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15/06/12 03:01, Christian Smith wrote: Except when the asynchronous IO module is used: http://www.sqlite.org/asyncvfs.html This VFS module will create a single background IO thread. No it doesn't. You have to create the thread for the

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

2012-06-15 Thread Jay A. Kreibich
On Fri, Jun 15, 2012 at 06:32:51AM +0200, Etienne scratched on the wall: The problem is: the real rounding error depends here on the shell (SQLite or JSDB) calling the SQLite library. This shouldn't be a surprise. The core SQLite API is expecting a 64-bit binary number. That's what goes

[sqlite] (shell dependent) library rounding error

2012-06-15 Thread Etienne
The problem is: the real rounding error depends here on the shell (SQLite or JSDB) calling the SQLite library. Yes. Different languages use different ways to hide the fact that they can't hide the 0.1. The difference of languages is irrelevant here. Both shells call SQLITE_API const

Re: [sqlite] Queries on SQLite

2012-06-15 Thread Keith Medcalf
SQLite does not create the thread. The application creates the thread and then runs the async writer on that application created thread. --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] order by clause should come after union not before

2012-06-15 Thread Keith Medcalf
select * from (select * from hbc order by cmc desc limit 10) as ss union select * from hbc where qph0 or hctl=1; --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org -Original Message- From:

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

2012-06-15 Thread Dominique Pellé
Etienne ejlist-sql...@yahoo.fr wrote: R:\sqlite NUL select 0.1; 0.1 JSDB (www.jsdb.org) output: jsvar db = new SQLite(); jsdb.exec(select 0.1, function(r){writeln(r)}); 0.1=0.11 true You are not doing the same thing both times.  One time you are writing the

[sqlite] read sql file in c++

2012-06-15 Thread sohu
I have a sql file, and I know in sqlite use .read my.sql to run sql cmd,but I don't know how to run the sql file in c++? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] read sql file in c++

2012-06-15 Thread Simon Slavin
On 16 Jun 2012, at 3:01am, sohu y...@sohu.com wrote: I have a sql file, and I know in sqlite use .read my.sql to run sql cmd,but I don't know how to run the sql file in c++? There is no way to do it in one command. You can write your own C++ code to read the text file one line at a time

Re: [sqlite] read sql file in c++

2012-06-15 Thread Igor Tandetnik
Simon Slavin slav...@bigfraud.org wrote: On 16 Jun 2012, at 3:01am, sohu y...@sohu.com wrote: I have a sql file, and I know in sqlite use .read my.sql to run sql cmd,but I don't know how to run the sql file in c++? There is no way to do it in one command. Well, for a reasonably sized