Re: [sqlite] Available alternatives to syntax diagrams in documentation

2010-03-23 Thread Shane Harrelson
More updates for Chrome support.

http://www.sqlite.org/docsrc/artifact/981f61a5e4


On Tue, Mar 23, 2010 at 11:50 PM, Shane Harrelson  wrote:

> I knocked out a quick TCl script that uses *exactly* the same syntax graph
> specification as bubble-generator.tcl but attempts to render the graphs
> without GIFs.   You can see the script here:
>
>
> http://www.sqlite.org/docsrc/finfo?name=art/syntax/bubble-generator-text.tcl
>
> You can view the output here:
>
> http://www.sqlite.org/docsrc/artifact/149ec0f41f
>
> The script still needs a little work (especially in browsers other than
> FF), but the graphs are reasonable similar to the GIF based versions and
> usable.
>
> I have no idea what kinds of things a "screen reader" would need to make
> this version useful, but if you let me know, I will try to add them.
>
> HTH.
> -Shane
>
>
>
> On Mon, Mar 22, 2010 at 2:29 PM, Jay A. Kreibich  wrote:
>
>> On Mon, Mar 22, 2010 at 11:13:25PM +0530, Roger Binns scratched on the
>> wall:
>> > -BEGIN PGP SIGNED MESSAGE-
>> > Hash: SHA1
>> >
>> > Jay A. Kreibich wrote:
>> > > On Mon, Mar 22, 2010 at 05:57:18PM +0530, Roger Binns scratched on the
>> wall:
>> > >
>> > >> If you are the developer type yourself then it is a simple matter of
>> > >> programming :-)
>> > >
>> > >   As someone that's been spending a lot of time with that script,
>> > >   excuse me while I run around the room laughing maniacally.
>> >
>> > Perhaps you may want to review the definition SMOP
>>
>>   Yes, I'm well aware.  I was confirming, not trying to contradict.
>>
>>  And in defense of the script, the biggest issue is that I don't
>>  know TCL and it's somewhat casual syntax for literals can be very
>>  frustrating for someone that has not used this class of language.
>>
>>   -j
>>
>> --
>> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>>
>> "Our opponent is an alien starship packed with atomic bombs.  We have
>>  a protractor."   "I'll go home and see if I can scrounge up a ruler
>>  and a piece of string."  --from Anathem by Neal Stephenson
>> ___
>> 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] Available alternatives to syntax diagrams in documentation

2010-03-23 Thread Shane Harrelson
I knocked out a quick TCl script that uses *exactly* the same syntax graph
specification as bubble-generator.tcl but attempts to render the graphs
without GIFs.   You can see the script here:

http://www.sqlite.org/docsrc/finfo?name=art/syntax/bubble-generator-text.tcl

You can view the output here:

http://www.sqlite.org/docsrc/artifact/149ec0f41f

The script still needs a little work (especially in browsers other than FF),
but the graphs are reasonable similar to the GIF based versions and usable.

I have no idea what kinds of things a "screen reader" would need to make
this version useful, but if you let me know, I will try to add them.

HTH.
-Shane


On Mon, Mar 22, 2010 at 2:29 PM, Jay A. Kreibich  wrote:

> On Mon, Mar 22, 2010 at 11:13:25PM +0530, Roger Binns scratched on the
> wall:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > Jay A. Kreibich wrote:
> > > On Mon, Mar 22, 2010 at 05:57:18PM +0530, Roger Binns scratched on the
> wall:
> > >
> > >> If you are the developer type yourself then it is a simple matter of
> > >> programming :-)
> > >
> > >   As someone that's been spending a lot of time with that script,
> > >   excuse me while I run around the room laughing maniacally.
> >
> > Perhaps you may want to review the definition SMOP
>
>   Yes, I'm well aware.  I was confirming, not trying to contradict.
>
>  And in defense of the script, the biggest issue is that I don't
>  know TCL and it's somewhat casual syntax for literals can be very
>  frustrating for someone that has not used this class of language.
>
>   -j
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Our opponent is an alien starship packed with atomic bombs.  We have
>  a protractor."   "I'll go home and see if I can scrounge up a ruler
>  and a piece of string."  --from Anathem by Neal Stephenson
> ___
> 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] difficulty installing sqlite3 into rubygems

2010-03-23 Thread James Richard Sheldon
I'm trying to install sqlite3 into Ruby Gems 1.9, and I get the following error:

$ sudo gem1.9 install sqlite3Building native extensions.  This could
take a while...
ERROR:  Error installing sqlite3:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9 extconf.rb
extconf.rb:2:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:2:in `'

Any thoughts?

@james

-- 

@ james sheldon
@ http://www.jamessheldon.com
@ voyager...@gmail.com

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


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Bernie Reiter
Dear all. Sorry! Ashes on my head :-)

Last night it was 3.00 in the morning before I got off my screen ...

Adding single quotes AND actually using sqlite did it (see below).

Txs again for all your help and patience.

bernie

sqlite> select strftime('%w','2010-03-21');
0
sqlite> select strftime('%w','2010-03-22');
1
sqlite> select strftime('%w','2010-03-23');
2
sqlite> select strftime('%w','2010-03-24');
3
sqlite> select strftime('%w','2010-03-25');
4
sqlite> select strftime('%w','2010-03-26');
5
sqlite> select strftime('%w','2010-03-27');
6
sqlite> select strftime('%w','2010-03-28');
0



- Original Message 
From: Nicolas Williams 
To: Bernie Reiter 
Cc: sqlite-users@sqlite.org
Sent: Tue, 23 March, 2010 20:29:28
Subject: Re: [sqlite] Computing day of week the using strftime() function - 
Feature or bug ?

On Tue, Mar 23, 2010 at 07:25:56PM +, Bernie Reiter wrote:
> I am checking this for Sunday, March 21st 2010, Monday, 22nd March 2010 and 
> Tuesday, 23nd March 2010:
> 
> Sunday, March 21st 2010:SELECT strftime('%w',2010-03-21); => 6

You need single quotes around the date value.

2010-03-21 == 2010 + -03 + -21 -- surely not what you intended.

Nico
-- 



  

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


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread P Kishor
On Tue, Mar 23, 2010 at 2:58 PM, Bernie Reiter
 wrote:
> Nico, thanks for your quick reply.
>
> I have copied the function strftime('%Y-%m-%d', ...) directly the sqlite 
> documentation
> and substituted the ... with my date string.
> Unfortunately, your advice doesn't seem to convince my Linux box,
> neither with a straight single quote nor with a "backwards leaning" single 
> quote
>
> [liveu...@localhost ~]$ SELECT strftime('%w','2010-03-21');
> bash: syntax error near unexpected token `('
>
>
> [liveu...@localhost ~]$ SELECT strftime('%w',`2010-03-21`);
> bash: syntax error near unexpected token `('
>


Bernie, you need to take a break and get a cup of coffee ;-)

Then, make sure you start sqlite before issuing a sqlite command. As
shown above, you are trying to query a db from bash, bash has no clue
what to do.


>
>
>
>
> - Original Message 
> From: Nicolas Williams 
> To: Bernie Reiter 
> Cc: sqlite-users@sqlite.org
> Sent: Tue, 23 March, 2010 20:29:28
> Subject: Re: [sqlite] Computing day of week the using strftime() function - 
> Feature or bug ?
>
> On Tue, Mar 23, 2010 at 07:25:56PM +, Bernie Reiter wrote:
>> I am checking this for Sunday, March 21st 2010, Monday, 22nd March 2010 and 
>> Tuesday, 23nd March 2010:
>>
>> Sunday, March 21st 2010:    SELECT strftime('%w',2010-03-21); => 6
>
> You need single quotes around the date value.
>
> 2010-03-21 == 2010 + -03 + -21 -- surely not what you intended.
>
> Nico
> --
>
>
>
>
>


-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
---
Assertions are politics; backing up assertions with evidence is science
===
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Igmar Palsenberg
On 3/23/10 8:58 PM, Bernie Reiter wrote:
> Nico, thanks for your quick reply.
>
> I have copied the function strftime('%Y-%m-%d', ...) directly the sqlite 
> documentation
> and substituted the ... with my date string.
> Unfortunately, your advice doesn't seem to convince my Linux box,
> neither with a straight single quote nor with a "backwards leaning" single 
> quote
>
> [liveu...@localhost ~]$ SELECT strftime('%w','2010-03-21');
> bash: syntax error near unexpected token `('
>
>
> [liveu...@localhost ~]$ SELECT strftime('%w',`2010-03-21`);
> bash: syntax error near unexpected token `('
>
You're talking to bash, not sqlite.



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


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Bernie Reiter
Nico, thanks for your quick reply.

I have copied the function strftime('%Y-%m-%d', ...) directly the sqlite 
documentation 
and substituted the ... with my date string.
Unfortunately, your advice doesn't seem to convince my Linux box, 
neither with a straight single quote nor with a "backwards leaning" single quote

[liveu...@localhost ~]$ SELECT strftime('%w','2010-03-21');
bash: syntax error near unexpected token `('


[liveu...@localhost ~]$ SELECT strftime('%w',`2010-03-21`);
bash: syntax error near unexpected token `('

Txs

bernue




- Original Message 
From: Nicolas Williams 
To: Bernie Reiter 
Cc: sqlite-users@sqlite.org
Sent: Tue, 23 March, 2010 20:29:28
Subject: Re: [sqlite] Computing day of week the using strftime() function - 
Feature or bug ?

On Tue, Mar 23, 2010 at 07:25:56PM +, Bernie Reiter wrote:
> I am checking this for Sunday, March 21st 2010, Monday, 22nd March 2010 and 
> Tuesday, 23nd March 2010:
> 
> Sunday, March 21st 2010:SELECT strftime('%w',2010-03-21); => 6

You need single quotes around the date value.

2010-03-21 == 2010 + -03 + -21 -- surely not what you intended.

Nico
-- 



  

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


Re: [sqlite] Question about binding

2010-03-23 Thread Vance E. Neff
Thanks to all those who responded!  It was quite educational.
I'm using the zentus java jdbc wrapper.  It seems to only support an 
index # for the binding index so I'm stuck with being careful as to how 
I count ?s.
Is there documentation that talks about about the various binding place 
holders or is this a standard SQL construct?

Vance

D. Richard Hipp wrote:
> On Mar 19, 2010, at 3:29 PM, David Bicking wrote:
> 
>>
>> --- On Fri, 3/19/10, Vance E. Neff  wrote:
>>
>> 
>>> UPDATE table1 set (?, ?, ?) WHERE col1=? and col2=?;
>>>
>>> I've never used binding before but have known it is a good
>>> idea in order
>>> to avoid injection of bad stuff.
>>>
>>> Vance
>>>
>> You count the question marks from left to right.
>>
>>> UPDATE table1 set (<1>, <2>, <3>) WHERE col1=<4> and col2=<5>;
>> You can also put the index number you want to use after the ? so  
>> they can be in any order you want.
> 
> Better still is to use a symbolic name for the parameters.  The  
> symbolic names can be any identifier that begins with $, :, or @.   
> Examples:
> 
> UPDATE table1 SET col1=$c1val, co...@c2val, col3=:c3val
>   WHERE co...@c2val AND col3=:c3val;
> 
> You still have to translate the symbolic name into a "parameter index"  
> before you bind it.  The sqlite3_bind_parameter_index() routine will  
> do that for you.
> 
> In the programs I write, I always try to use symbolic names for  
> parameters and I rig the infrastructure to handle the mapping from  
> symbolic name to parameter index.  For example, if you are using the  
> TCL interface to SQLite, you just specify TCL variables embedded in  
> the SQL:
> 
>   db eval {UPDATE table1 SET col1=$c1val WHERE col2=$c2val}
> 
> In the statement above, the TCL interface automatically looks up the  
> values of TCL variables $c1val and $c2val and binds them appropriately  
> before running the statement.  It doesn't get any cleaner than this.   
> Unfortunately, other programming languages require more complex  
> syntax.  In the implementation of "Fossil" I do this:
> 
>   db_prepare(, "UPDATE table1 SET col1=$c1val WHERE col2= 
> $c2val");
>   db_bind_int(, "$c1val", 123);
>   db_bind_double(, "$c2val, 456.78);
>   db_step();
>   db_finalize();
> 
> The db_bind_int() and db_bind_double() and similar routines wrap the  
> sqlite3_bind_x() and sqlite3_bind_parameter_index() calls.
> 
> If we've learned one thing over the history of computing it is that  
> programmers are notoriously bad at counting parameters and that  
> symbolic names tend to be much better at avoiding bugs.
> 
> D. Richard Hipp
> d...@hwaci.com
> 
> 
> 
> ___
> 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] SQlite C API screwing port access?

2010-03-23 Thread Simon Slavin

On 23 Mar 2010, at 7:29pm, Martin Sigwald wrote:

> DB_NAME equals "servers.db".
> Both close and open return 0, my code catches a possible error, I didnt
> included for legibility.
> I tired using ":memory:", same result: cant ping.
> These is quite frustrating.

Hmm.  Thanks for trying.  If both of those fail, I haven't clue what's wrong.  
The _close routine is too complicated to let me strip it.  You need someone 
with a better knowledge of S3 than I have.  Sorry.

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


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Jay A. Kreibich
On Tue, Mar 23, 2010 at 07:25:56PM +, Bernie Reiter scratched on the wall:

> Sunday, March 21st 2010:SELECT strftime('%w',2010-03-21); => 6
> Monday, March 22nd 2010:   SELECT strftime('%w',2010-03-22); => 5
> Tuesday, March 23nd 2010:  SELECT strftime('%w',2010-03-23); => 4


  Try putting quotes around those... e.g.: strftime('%w','2010-03-21');

  The way you've written it, you're computing 2010 minus 03 minus 21,
  e.g. the integer 1986.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Stephan Wehner
On Tue, Mar 23, 2010 at 12:25 PM, Bernie Reiter
 wrote:
> Dear Dr. Hipp,

> SELECT strftime('%w',2010-03-22 22:12:40) ; => SQL error near "22": syntax 
> error
Add quotes:

SELECT strftime('%w','2010-03-22 22:12:40');

See the section Examples at http://www.sqlite.org/lang_datefunc.html


Stephan

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



-- 
Stephan Wehner

-> http://stephan.sugarmotor.org (blog and homepage)
-> http://loggingit.com
-> http://www.thrackle.org
-> http://www.buckmaster.ca
-> http://www.trafficlife.com
-> http://stephansmap.org -- http://blog.stephansmap.org
-> http://twitter.com/stephanwehner / @stephanwehner
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Nicolas Williams
On Tue, Mar 23, 2010 at 07:25:56PM +, Bernie Reiter wrote:
> I am checking this for Sunday, March 21st 2010, Monday, 22nd March 2010 and 
> Tuesday, 23nd March 2010:
> 
> Sunday, March 21st 2010:SELECT strftime('%w',2010-03-21); => 6

You need single quotes around the date value.

2010-03-21 == 2010 + -03 + -21 -- surely not what you intended.

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
DB_NAME equals "servers.db".
Both close and open return 0, my code catches a possible error, I didnt
included for legibility.
I tired using ":memory:", same result: cant ping.
These is quite frustrating.

On Tue, Mar 23, 2010 at 4:23 PM, Simon Slavin  wrote:

>
> On 23 Mar 2010, at 7:06pm, Martin Sigwald wrote:
>
> > Here is the actual code:
> >
> > int main(void)
> > {
> >sqlite3* db_handle;
> >
> > sqlite3_open(DB_NAME,_handle);
> > sqlite3_close(db_handle);
> > my_ping("10.0.0.4");
> >
> >  return 0;
> > }
> >
> > If I call close after ping, it works. However, if besides of opening the
> DB
> > I perform any query, ping doesnt work either.
>
> I suspect that your value for DB_NAME has some bad syntax in it which has a
> result only when you try to close the database.  Please tell us what values
> are returned by _open and _close.  The value returned should be an integer:
>
>  int rcOpen, rcClose;
>  rcOpen = sqlite3_open(DB_NAME,_handle);
>  // output the value of rcOpen here
>  rcClose = sqlite3_close(db_handle);
>  // output the value of rcClose here
>
> You can see possible result codes here: <
> http://www.sqlite.org/c3ref/c_abort.html>
>
> If both functions yield zero in your test, indicating all is fine, please
> try this new test code using ":memory:" where you currently have DB_NAME and
> see if your program still locks up.
>
> 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] Computing day of week the using strftime() function - Feature or bug ?

2010-03-23 Thread Bernie Reiter
Dear Dr. Hipp,

SQLite is a wonderful tool. Thanks a LOT ! I am working every day with it and 
love it more and more :-)
Only sometimes I am confused. Maybe the community can help or enlighten me.

Thanks again

bernie


1) My environment:
--
[liveu...@localhost ~]$ date
Mon Mar 22 22:12:40 CET 2010

Platform: Fedora V12 64 bit live version on AMD 64bit single core 1800MHz

[liveu...@localhost ~]$ sqlite3 --version
3.6.20

("yum install sqlite" does not update to current version: 2010-Mar-09 - Version 
3.6.23)
Package sqlite-3.6.20-1.fc12.x86_64 already installed and latest version
Nothing to do


2) Excerpts from the sqlite online documentation 
(http://sqlite.org/lang_datefunc.html)
---

Date And Time Functions:


Time Strings

A time string can be in any of the following formats:

   1. -MM-DD
   2. -MM-DD HH:MM
   3. -MM-DD HH:MM:SS 
...

The strftime() function also takes a format string as its first argument. 

FunctionEquivalent strftime()
date(...) strftime('%Y-%m-%d', ...) 

%w  day of week 0-6 with sunday==0 



3) Now me:
--
I am checking this for Sunday, March 21st 2010, Monday, 22nd March 2010 and 
Tuesday, 23nd March 2010:

Sunday, March 21st 2010:SELECT strftime('%w',2010-03-21); => 6
Monday, March 22nd 2010:   SELECT strftime('%w',2010-03-22); => 5
Tuesday, March 23nd 2010:  SELECT strftime('%w',2010-03-23); => 4

Monday, 22nd March 2010 22:12:40 h: 
SELECT strftime('%w',2010-03-22 22:12:40) ; => SQL error near "22": syntax error


Here is the verbatim copy from my command line:

[liveu...@localhost ~]$ sqlite3 
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT strftime('%w',2010-03-21);
6
sqlite> SELECT strftime('%w',2010-03-22);
5
sqlite> SELECT strftime('%w',2010-03-23);
4
sqlite> SELECT strftime('%w',2010-03-24);
3
sqlite> SELECT strftime('%w',2010-03-25);
2
sqlite> SELECT strftime('%w',2010-03-26);
1
sqlite> SELECT strftime('%w',2010-03-27);
0
sqlite> 



  

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Simon Slavin

On 23 Mar 2010, at 7:06pm, Martin Sigwald wrote:

> Here is the actual code:
> 
> int main(void)
> {
>sqlite3* db_handle;
> 
> sqlite3_open(DB_NAME,_handle);
> sqlite3_close(db_handle);
> my_ping("10.0.0.4");
> 
>  return 0;
> }
> 
> If I call close after ping, it works. However, if besides of opening the DB
> I perform any query, ping doesnt work either.

I suspect that your value for DB_NAME has some bad syntax in it which has a 
result only when you try to close the database.  Please tell us what values are 
returned by _open and _close.  The value returned should be an integer:

  int rcOpen, rcClose;
  rcOpen = sqlite3_open(DB_NAME,_handle);
  // output the value of rcOpen here
  rcClose = sqlite3_close(db_handle);
  // output the value of rcClose here

You can see possible result codes here: 


If both functions yield zero in your test, indicating all is fine, please try 
this new test code using ":memory:" where you currently have DB_NAME and see if 
your program still locks up.

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
Here is the actual code:

int main(void)
{
sqlite3* db_handle;

 sqlite3_open(DB_NAME,_handle);
 sqlite3_close(db_handle);
 my_ping("10.0.0.4");

  return 0;
}

If I call close after ping, it works. However, if besides of opening the DB
I perform any query, ping doesnt work either.

On Tue, Mar 23, 2010 at 3:45 PM, Matthew L. Creech wrote:

> On Tue, Mar 23, 2010 at 12:55 PM, Martin Sigwald 
> wrote:
> > I have a program which builds an ICMP package over IP and sends it.
> Before
> > that, I get IP number and other information from a SQlite DB. I was
> having
> > problems, so I began to comment different parts of the code, until I got
> to
> > this code (pseudocode):
> >
> > sqlite3_open(DB_NAME);
> > sqlite3_close(DB_NAME);
> >
> > ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded"
> IP,
> > doesnt interact with DB
> >
>
> Could you post the actual code snippet?  For example, sqlite3_close()
> doesn't take a string - you did say it's pseudocode, I'm just
> wondering if there's a problem with the arguments along those lines.
>
> --
> Matthew L. Creech
> ___
> 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] fast acces to one memory located table from two threads

2010-03-23 Thread Jakub Ladman
Dne úterý 23 března 2010 19:22:35 Pavel Ivanov napsal(a):
> I'd suggest you to use any kind of memory structure (like deque or

:-) I do not know what is deque.

> whatever you prefer) for transferring data from one thread to another.
> Besides anything else it will be faster than using SQLite for this
> particular task.

For better understanding, i need not only to transfer data between threads, 
but store fast in first thread and read sorted data in the second.
Sorting have to be done via some complex SELECTs.

If it is not possible, i will think about completely different schema, but i 
have no idea at this time, how to do it different way.

Jakub Ladman

> 
> As you have already understood there's no way you can make 2
> connections to one in-memory database. Although you can use one
> connection from both thread so that threads will naturally block each
> other while they're doing their piece of job.
> 
> 
> Pavel
> 
> On Tue, Mar 23, 2010 at 1:55 PM, Jakub Ladman  wrote:
> > Hello to all
> >
> > I am back here to mailing list after about two years and also back to
> > programming with sqlite in general.
> >
> > I have new task and i do not know how to do it.
> >
> > I need an application consisting two threads.
> > In one of them i need to store incomming "messages" (one message is 1 to
> > 8 bytes of data) to temporary table existing only in memory.
> > It needs to be fast, storing hundreds of messages per second.
> > There i have a trigger deleting old rows and creating some sort of
> > circular buffer.
> > In separate thread there should be done some selects (read only) on this
> > table sorting the informations and storing them into separate table(s)
> > located on disk (jffs2 filesystem).
> >
> > I do not know how to do two connections to memory stored table(fast, and
> > not wasting the flash memory writes).
> > The database opened as :memory: is separate for every thread, same as
> > temporary table with pragma temp_store = MEMORY.
> >
> > Do you have any clue?
> > Is it completely stupid way?
> >
> > Thank You
> >
> > Jakub Ladman
> > ___
> > 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] fast acces to one memory located table from two threads

2010-03-23 Thread Teg

Yeah, I do this all the time with STL and a critical section lock. A
list, or set and a lock is all you need. list of vectors for instance.
Set if you want it to automatically reject duplicated, a list for just
dumping data to it.

C



Tuesday, March 23, 2010, 2:22:35 PM, you wrote:

PI> I'd suggest you to use any kind of memory structure (like deque or
PI> whatever you prefer) for transferring data from one thread to another.
PI> Besides anything else it will be faster than using SQLite for this
PI> particular task.

PI> As you have already understood there's no way you can make 2
PI> connections to one in-memory database. Although you can use one
PI> connection from both thread so that threads will naturally block each
PI> other while they're doing their piece of job.


PI> Pavel

PI> On Tue, Mar 23, 2010 at 1:55 PM, Jakub Ladman  wrote:
>> Hello to all
>>
>> I am back here to mailing list after about two years and also back to
>> programming with sqlite in general.
>>
>> I have new task and i do not know how to do it.
>>
>> I need an application consisting two threads.
>> In one of them i need to store incomming "messages" (one message is 1 to 8
>> bytes of data) to temporary table existing only in memory.
>> It needs to be fast, storing hundreds of messages per second.
>> There i have a trigger deleting old rows and creating some sort of circular
>> buffer.
>> In separate thread there should be done some selects (read only) on this 
>> table
>> sorting the informations and storing them into separate table(s) located on
>> disk (jffs2 filesystem).
>>
>> I do not know how to do two connections to memory stored table(fast, and not
>> wasting the flash memory writes).
>> The database opened as :memory: is separate for every thread, same as
>> temporary table with pragma temp_store = MEMORY.
>>
>> Do you have any clue?
>> Is it completely stupid way?
>>
>> Thank You
>>
>> Jakub Ladman
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
PI> ___
PI> sqlite-users mailing list
PI> sqlite-users@sqlite.org
PI> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Tegmailto:t...@djii.com

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Matthew L. Creech
On Tue, Mar 23, 2010 at 12:55 PM, Martin Sigwald  wrote:
> I have a program which builds an ICMP package over IP and sends it. Before
> that, I get IP number and other information from a SQlite DB. I was having
> problems, so I began to comment different parts of the code, until I got to
> this code (pseudocode):
>
> sqlite3_open(DB_NAME);
> sqlite3_close(DB_NAME);
>
> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
> doesnt interact with DB
>

Could you post the actual code snippet?  For example, sqlite3_close()
doesn't take a string - you did say it's pseudocode, I'm just
wondering if there's a problem with the arguments along those lines.

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Pavel Ivanov
> Pavel: Yes, I allocate memory inside the ping function, but that is done
> after calling de sqlite functions. There are no pointers shared between the
> sqlite functions and the ping part.

Actually I meant pointers shared between ping part and the part before
calls to sqlite functions.
Did you try running under valgrind?


Pavel

On Tue, Mar 23, 2010 at 2:10 PM, Martin Sigwald  wrote:
> I already tried that, and the first ping works while the second one doesn't,
> which validates my "screwing ports theory".
>
> Simon: Tried changing the DB_NAME and it didnt work either.
>
> Pavlov: Yes, I allocate memory inside the ping function, but that is done
> after calling de sqlite functions. There are no pointers shared between the
> sqlite functions and the ping part.
>
> On Tue, Mar 23, 2010 at 3:00 PM, Teg  wrote:
>
>> Hello Martin,
>>
>> Do the ping both before and after you open the DB.
>>
>> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
>> sqlite3_open(DB_NAME);
>> sqlite3_close(DB_NAME);
>> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
>>
>> See if the first one works. That'll validate your theory. My guess is
>> the first one won't work either and you're barking up the wrong tree.
>>
>> C
>>
>> Tuesday, March 23, 2010, 12:55:36 PM, you wrote:
>>
>> MS> I have a program which builds an ICMP package over IP and sends it.
>> Before
>> MS> that, I get IP number and other information from a SQlite DB. I was
>> having
>> MS> problems, so I began to comment different parts of the code, until I
>> got to
>> MS> this code (pseudocode):
>>
>> MS> sqlite3_open(DB_NAME);
>> MS> sqlite3_close(DB_NAME);
>>
>> MS> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded"
>> IP,
>> MS> doesnt interact with DB
>>
>>
>> MS> If I run that code, the package nevers gets send (can't detect it with
>> MS> Wireshark). If a comment the sqlite part, it works perfectly. Somehow,
>> the
>> MS> SQlite function calls are screwing with the port access, but I can't
>> fin any
>> MS> reasonable explanation.
>> MS> Any ideas?
>> MS> I've been stuck for days with this problem.
>>
>> MS> Regards,
>> MS> Martin Sigwald
>> MS> ___
>> MS> sqlite-users mailing list
>> MS> sqlite-users@sqlite.org
>> MS> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>>
>> --
>> Best regards,
>>  Teg                            mailto:t...@djii.com
>>
>> ___
>> 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] fast acces to one memory located table from two threads

2010-03-23 Thread Pavel Ivanov
I'd suggest you to use any kind of memory structure (like deque or
whatever you prefer) for transferring data from one thread to another.
Besides anything else it will be faster than using SQLite for this
particular task.

As you have already understood there's no way you can make 2
connections to one in-memory database. Although you can use one
connection from both thread so that threads will naturally block each
other while they're doing their piece of job.


Pavel

On Tue, Mar 23, 2010 at 1:55 PM, Jakub Ladman  wrote:
> Hello to all
>
> I am back here to mailing list after about two years and also back to
> programming with sqlite in general.
>
> I have new task and i do not know how to do it.
>
> I need an application consisting two threads.
> In one of them i need to store incomming "messages" (one message is 1 to 8
> bytes of data) to temporary table existing only in memory.
> It needs to be fast, storing hundreds of messages per second.
> There i have a trigger deleting old rows and creating some sort of circular
> buffer.
> In separate thread there should be done some selects (read only) on this table
> sorting the informations and storing them into separate table(s) located on
> disk (jffs2 filesystem).
>
> I do not know how to do two connections to memory stored table(fast, and not
> wasting the flash memory writes).
> The database opened as :memory: is separate for every thread, same as
> temporary table with pragma temp_store = MEMORY.
>
> Do you have any clue?
> Is it completely stupid way?
>
> Thank You
>
> Jakub Ladman
> ___
> 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] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
I already tried that, and the first ping works while the second one doesn't,
which validates my "screwing ports theory".

Simon: Tried changing the DB_NAME and it didnt work either.

Pavlov: Yes, I allocate memory inside the ping function, but that is done
after calling de sqlite functions. There are no pointers shared between the
sqlite functions and the ping part.

On Tue, Mar 23, 2010 at 3:00 PM, Teg  wrote:

> Hello Martin,
>
> Do the ping both before and after you open the DB.
>
> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
> sqlite3_open(DB_NAME);
> sqlite3_close(DB_NAME);
> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
>
> See if the first one works. That'll validate your theory. My guess is
> the first one won't work either and you're barking up the wrong tree.
>
> C
>
> Tuesday, March 23, 2010, 12:55:36 PM, you wrote:
>
> MS> I have a program which builds an ICMP package over IP and sends it.
> Before
> MS> that, I get IP number and other information from a SQlite DB. I was
> having
> MS> problems, so I began to comment different parts of the code, until I
> got to
> MS> this code (pseudocode):
>
> MS> sqlite3_open(DB_NAME);
> MS> sqlite3_close(DB_NAME);
>
> MS> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded"
> IP,
> MS> doesnt interact with DB
>
>
> MS> If I run that code, the package nevers gets send (can't detect it with
> MS> Wireshark). If a comment the sqlite part, it works perfectly. Somehow,
> the
> MS> SQlite function calls are screwing with the port access, but I can't
> fin any
> MS> reasonable explanation.
> MS> Any ideas?
> MS> I've been stuck for days with this problem.
>
> MS> Regards,
> MS> Martin Sigwald
> MS> ___
> MS> sqlite-users mailing list
> MS> sqlite-users@sqlite.org
> MS> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> --
> Best regards,
>  Tegmailto:t...@djii.com
>
> ___
> 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] SQlite C API screwing port access?

2010-03-23 Thread Teg
Hello Martin,

Do the ping both before and after you open the DB.

ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
sqlite3_open(DB_NAME);
sqlite3_close(DB_NAME);
ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,

See if the first one works. That'll validate your theory. My guess is
the first one won't work either and you're barking up the wrong tree.

C

Tuesday, March 23, 2010, 12:55:36 PM, you wrote:

MS> I have a program which builds an ICMP package over IP and sends it. Before
MS> that, I get IP number and other information from a SQlite DB. I was having
MS> problems, so I began to comment different parts of the code, until I got to
MS> this code (pseudocode):

MS> sqlite3_open(DB_NAME);
MS> sqlite3_close(DB_NAME);

MS> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
MS> doesnt interact with DB


MS> If I run that code, the package nevers gets send (can't detect it with
MS> Wireshark). If a comment the sqlite part, it works perfectly. Somehow, the
MS> SQlite function calls are screwing with the port access, but I can't fin any
MS> reasonable explanation.
MS> Any ideas?
MS> I've been stuck for days with this problem.

MS> Regards,
MS> Martin Sigwald
MS> ___
MS> sqlite-users mailing list
MS> sqlite-users@sqlite.org
MS> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Tegmailto:t...@djii.com

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


[sqlite] fast acces to one memory located table from two threads

2010-03-23 Thread Jakub Ladman
Hello to all

I am back here to mailing list after about two years and also back to 
programming with sqlite in general.

I have new task and i do not know how to do it.

I need an application consisting two threads. 
In one of them i need to store incomming "messages" (one message is 1 to 8 
bytes of data) to temporary table existing only in memory. 
It needs to be fast, storing hundreds of messages per second.
There i have a trigger deleting old rows and creating some sort of circular 
buffer.
In separate thread there should be done some selects (read only) on this table 
sorting the informations and storing them into separate table(s) located on 
disk (jffs2 filesystem).

I do not know how to do two connections to memory stored table(fast, and not 
wasting the flash memory writes).
The database opened as :memory: is separate for every thread, same as 
temporary table with pragma temp_store = MEMORY.

Do you have any clue?
Is it completely stupid way?

Thank You

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Simon Slavin

On 23 Mar 2010, at 4:55pm, Martin Sigwald wrote:

> sqlite3_open(DB_NAME);
> sqlite3_close(DB_NAME);
> 
> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
> doesnt interact with DB
> 
> 
> If I run that code, the package nevers gets send (can't detect it with
> Wireshark). If a comment the sqlite part, it works perfectly. Somehow, the
> SQlite function calls are screwing with the port access, but I can't fin any
> reasonable explanation.

Fascinating.  Okay, first try changing the DB_NAME to something else.  If the 
original is a file on a network share, try a local file.  Or try a file in your 
home folder.  Or try a SQLite database in memory.

Another approach is to omit the _close.  Just for your test application.  Or 
put the _close after the ping_server.  I know it's bad programming but there's 
no actual code there anyway.  See if it's the _open or _close that's the 
problem.

If neither of these give you a clue to the problem you could possibly copy the 
sqlite3 functions from the source code and include them specifically into your 
source code.  Then start stripping the functions themselves down to the bare 
bones.

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


Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Pavel Ivanov
Does your pinging code involves some pointers to memory (strings or
any other stuff) that could be already released before SQLite code is
called? Try to run your program under valgrind and see whether it
gives any errors.

Pavel

On Tue, Mar 23, 2010 at 12:55 PM, Martin Sigwald  wrote:
> I have a program which builds an ICMP package over IP and sends it. Before
> that, I get IP number and other information from a SQlite DB. I was having
> problems, so I began to comment different parts of the code, until I got to
> this code (pseudocode):
>
> sqlite3_open(DB_NAME);
> sqlite3_close(DB_NAME);
>
> ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
> doesnt interact with DB
>
>
> If I run that code, the package nevers gets send (can't detect it with
> Wireshark). If a comment the sqlite part, it works perfectly. Somehow, the
> SQlite function calls are screwing with the port access, but I can't fin any
> reasonable explanation.
> Any ideas?
> I've been stuck for days with this problem.
>
> Regards,
> Martin Sigwald
> ___
> 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] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
I have a program which builds an ICMP package over IP and sends it. Before
that, I get IP number and other information from a SQlite DB. I was having
problems, so I began to comment different parts of the code, until I got to
this code (pseudocode):

sqlite3_open(DB_NAME);
sqlite3_close(DB_NAME);

ping_server("10.0.0.4"); //my ping function, which pings a "hardcoded" IP,
doesnt interact with DB


If I run that code, the package nevers gets send (can't detect it with
Wireshark). If a comment the sqlite part, it works perfectly. Somehow, the
SQlite function calls are screwing with the port access, but I can't fin any
reasonable explanation.
Any ideas?
I've been stuck for days with this problem.

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


[sqlite] Usage of SQLITE_OMIT_DISKIO and SQLITE_OMIT_MEMORYDB

2010-03-23 Thread ramesh.kotabagi
Hi,
 
SQLITE_OMIT_DISKIO :
This option omits all support for writing to the disk and forces
databases to exist in memory only.
 
SQLITE_OMIT_MEMORYDB:
When this is defined, the library does not respect the special database
name ":memory:" (normally used to create an in-memory database). If
":memory:" is passed to sqlite3_open(), sqlite3_open16(), or
sqlite3_open_v2(), a file with this name will be opened or created,
 
1) Using flag, will DB is stored in RAM.. ?
2) Will access to DB(read and write) become faster compared to one
normal file format DB.
3) How the DB is maintained here, file OR data structure ?
 
 
Currently we are using sqlite in normal mode, without using these
option, how much these flags help,
to make faster access to DB(write and read)
 
Thanks in advance,
 
Regards,
Ramesh
 
 
 
 
 

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

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


Re: [sqlite] Reading the VDBE program

2010-03-23 Thread Navaneeth Sen B
Hello all,

So what you guys suggest is to stop studying the SQLite internals, jump 
to the programming area
and get to my aim.

Thankyou all for your suggestions :-)

Regards,
*Navaneeth Sen B.*

On 3/23/2010 6:46 PM, Pavel Ivanov wrote:
>> The best way to make a wrapper round SQLite is to use its
>> API, which is generally thought of as "programming using SQLite".
>>  
> I agree with that. And to make a good wrapper without changing SQLite
> itself you don't need to know the most part of SQLite's internals,
> especially you don't ever need to know how VDBE works.
>
> Pavel
>
> On Tue, Mar 23, 2010 at 9:06 AM, Hamish Allan  wrote:
>
>> On Tue, Mar 23, 2010 at 1:02 PM, Navaneeth Sen B
>>   wrote:
>>
>>  
>>> My ultimate aim is not to program using SQLite.
>>> I just want to know the internals of it? How it works?
>>> How i can make a new wrapper around it so that my exsisting applications
>>> can use it without huge changes..
>>>
>> The first and third of these statements seem to contradict one
>> another. The best way to make a wrapper round SQLite is to use its
>> API, which is generally thought of as "programming using SQLite".
>>
>> Best wishes,
>> Hamish
>> ___
>> 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] Reading the VDBE program

2010-03-23 Thread Pavel Ivanov
> The best way to make a wrapper round SQLite is to use its
> API, which is generally thought of as "programming using SQLite".

I agree with that. And to make a good wrapper without changing SQLite
itself you don't need to know the most part of SQLite's internals,
especially you don't ever need to know how VDBE works.

Pavel

On Tue, Mar 23, 2010 at 9:06 AM, Hamish Allan  wrote:
> On Tue, Mar 23, 2010 at 1:02 PM, Navaneeth Sen B
>  wrote:
>
>> My ultimate aim is not to program using SQLite.
>> I just want to know the internals of it? How it works?
>> How i can make a new wrapper around it so that my exsisting applications
>> can use it without huge changes..
>
> The first and third of these statements seem to contradict one
> another. The best way to make a wrapper round SQLite is to use its
> API, which is generally thought of as "programming using SQLite".
>
> Best wishes,
> Hamish
> ___
> 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] suggestion - make pragma case_sensitive_like queryable

2010-03-23 Thread Bogdan Ureche
>
>
> The setting is detectable:
>
>
Simon, thank you for the reply. It's not exactly the answer I was hoping
for, but I suppose fixing this is a low priority if there is a workaround.

Regards,

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


Re: [sqlite] Reading the VDBE program

2010-03-23 Thread Hamish Allan
On Tue, Mar 23, 2010 at 1:02 PM, Navaneeth Sen B
 wrote:

> My ultimate aim is not to program using SQLite.
> I just want to know the internals of it? How it works?
> How i can make a new wrapper around it so that my exsisting applications
> can use it without huge changes..

The first and third of these statements seem to contradict one
another. The best way to make a wrapper round SQLite is to use its
API, which is generally thought of as "programming using SQLite".

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


Re: [sqlite] Reading the VDBE program

2010-03-23 Thread Navaneeth Sen B
Hi Pavel,
You are right it contains sqlite3.c and sqlite3.h.

"if you run Linux then I believe SQLite can be
compiled and work right away without any additional platform-specific
tuning and learning of internal magic. ;-)"

My ultimate aim is not to program using SQLite.
I just want to know the internals of it? How it works?
How i can make a new wrapper around it so that my exsisting applications 
can use it without huge changes..

Regards,
*Navaneeth Sen B.*

On 3/23/2010 6:22 PM, Pavel Ivanov wrote:
>>  The first one does not include any source files.
>>  
> Are you sure about that? First archive should contain one source file
> - sqlite3.c which is enough to compile SQLite at least in standard
> configuration. And btw, if you run Linux then I believe SQLite can be
> compiled and work right away without any additional platform-specific
> tuning and learning of internal magic. ;-)
>
> Pavel
>
> On Tue, Mar 23, 2010 at 8:47 AM, Navaneeth Sen B
>   wrote:
>
>> No, I was just trying to study how the whole magic happens when you do
>> the steps.
>> My ultimate aim is to port this to a mips platform running linux on it.
>> I donno whether it will be helpful for my purpose.
>>
>> Another doubt is that i have downloaded two tar balls from the site.
>>
>>1. sqlite-amalgamation-3.6.23.tar.gz
>>   
>>2. sqlite-3.6.23.tar.gz
>>
>>
>> Which one should i use, so that i can bring up SQLite in my platform?
>> The sole reason behind the question is :
>>  The first one does not include any source files.
>>  The second one has the whole set of source files.
>>
>> Would you please help me with the word "Amalgamation"?
>>
>> Regards,
>> *Navaneeth Sen B.*
>>
>> On 3/23/2010 6:01 PM, Pavel Ivanov wrote:
>>  
>>> Just out of curiosity: what are you need it for? Do you think that
>>> it's necessary to use SQLite properly?
>>>
>>> Pavel
>>>
>>> On Tue, Mar 23, 2010 at 8:01 AM, Navaneeth Sen B
>>> wrote:
>>>
>>>
 Hello all,

 I am new to SQLite software. I have understood the structure of SQLite
 as described in the "Architecture of SQLite" manual.
 I am now reading the document named "The Virtual Database Engine of
 SQLite" which I got from the
 SQLite site.
 Currently i am working on Fedora 11 machine with SQLite version 3.6.20.
 I have a doubt while reading the VDBE program.

 sqlite>CREATE TABLE sample2(one char, two int, three float);
 sqlite>EXPLAIN INSERT INTO sample2 VALUES('Sen',685,87.6);

 addr  opcode p1p2p3 p4  p5  comment
  -  -
 ---
 0 Trace 0  0  000
 1 Goto   0 11 000
 2 OpenWrite  0 3   03  00
 3 NewRowid  0 2   000
 4 String8   0 3   0Sen   00
 5 Integer   685  4   000
 6 Real   0 50   87.6   00
 7 MakeRecord   3 36   ade00
 8 Insert 0 62   sample2 1b
 9 Close  0 0000
 10Halt   0 0000
 11Transaction0 1000
 12VerifyCookie   0 4   000
 13TableLock  0 31   sample200
 14Goto  0 2000

 I have many doubts as the vdbe program structure is different from the
 one explained in the document. The document is for SQLite 2.8.0.

 Now the area where i need more clarifications are :

  * OpenWrite
  * MakeRecord
  * Stack operations happening when you do a MakeRecord
  * NewRowid
  * Insert
  * TableLock

 I would like to know the function of each operands in the above stated
 cases and the related stack operations.


 --
 Regards,
 *Navaneeth Sen B.*

 ___
 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
>> 

Re: [sqlite] Reading the VDBE program

2010-03-23 Thread Pavel Ivanov
>     The first one does not include any source files.

Are you sure about that? First archive should contain one source file
- sqlite3.c which is enough to compile SQLite at least in standard
configuration. And btw, if you run Linux then I believe SQLite can be
compiled and work right away without any additional platform-specific
tuning and learning of internal magic. ;-)

Pavel

On Tue, Mar 23, 2010 at 8:47 AM, Navaneeth Sen B
 wrote:
> No, I was just trying to study how the whole magic happens when you do
> the steps.
> My ultimate aim is to port this to a mips platform running linux on it.
> I donno whether it will be helpful for my purpose.
>
> Another doubt is that i have downloaded two tar balls from the site.
>
>   1. sqlite-amalgamation-3.6.23.tar.gz
>      
>   2. sqlite-3.6.23.tar.gz 
>
>
> Which one should i use, so that i can bring up SQLite in my platform?
> The sole reason behind the question is :
>     The first one does not include any source files.
>     The second one has the whole set of source files.
>
> Would you please help me with the word "Amalgamation"?
>
> Regards,
> *Navaneeth Sen B.*
>
> On 3/23/2010 6:01 PM, Pavel Ivanov wrote:
>> Just out of curiosity: what are you need it for? Do you think that
>> it's necessary to use SQLite properly?
>>
>> Pavel
>>
>> On Tue, Mar 23, 2010 at 8:01 AM, Navaneeth Sen B
>>   wrote:
>>
>>> Hello all,
>>>
>>> I am new to SQLite software. I have understood the structure of SQLite
>>> as described in the "Architecture of SQLite" manual.
>>> I am now reading the document named "The Virtual Database Engine of
>>> SQLite" which I got from the
>>> SQLite site.
>>> Currently i am working on Fedora 11 machine with SQLite version 3.6.20.
>>> I have a doubt while reading the VDBE program.
>>>
>>> sqlite>  CREATE TABLE sample2(one char, two int, three float);
>>> sqlite>  EXPLAIN INSERT INTO sample2 VALUES('Sen',685,87.6);
>>>
>>> addr  opcode         p1    p2    p3     p4              p5  comment
>>>      -                  -
>>> --    -
>>> 0     Trace             0      0      0                        00
>>> 1     Goto               0     11     0                        00
>>> 2     OpenWrite      0     3       0        3              00
>>> 3     NewRowid      0     2       0                        00
>>> 4     String8           0     3       0        Sen           00
>>> 5     Integer           685  4       0                        00
>>> 6     Real               0     5        0       87.6           00
>>> 7     MakeRecord   3     3        6       ade            00
>>> 8     Insert             0     6        2       sample2     1b
>>> 9     Close              0     0        0                        00
>>> 10    Halt               0     0        0                        00
>>> 11    Transaction    0     1        0                        00
>>> 12    VerifyCookie   0     4       0                        00
>>> 13    TableLock      0     3        1       sample2    00
>>> 14    Goto              0     2        0                        00
>>>
>>> I have many doubts as the vdbe program structure is different from the
>>> one explained in the document. The document is for SQLite 2.8.0.
>>>
>>> Now the area where i need more clarifications are :
>>>
>>>     * OpenWrite
>>>     * MakeRecord
>>>     * Stack operations happening when you do a MakeRecord
>>>     * NewRowid
>>>     * Insert
>>>     * TableLock
>>>
>>> I would like to know the function of each operands in the above stated
>>> cases and the related stack operations.
>>>
>>>
>>> --
>>> Regards,
>>> *Navaneeth Sen B.*
>>>
>>> ___
>>> 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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Reading the VDBE program

2010-03-23 Thread Navaneeth Sen B
No, I was just trying to study how the whole magic happens when you do 
the steps.
My ultimate aim is to port this to a mips platform running linux on it.
I donno whether it will be helpful for my purpose.

Another doubt is that i have downloaded two tar balls from the site.

   1. sqlite-amalgamation-3.6.23.tar.gz
  
   2. sqlite-3.6.23.tar.gz 


Which one should i use, so that i can bring up SQLite in my platform?
The sole reason behind the question is :
 The first one does not include any source files.
 The second one has the whole set of source files.

Would you please help me with the word "Amalgamation"?

Regards,
*Navaneeth Sen B.*

On 3/23/2010 6:01 PM, Pavel Ivanov wrote:
> Just out of curiosity: what are you need it for? Do you think that
> it's necessary to use SQLite properly?
>
> Pavel
>
> On Tue, Mar 23, 2010 at 8:01 AM, Navaneeth Sen B
>   wrote:
>
>> Hello all,
>>
>> I am new to SQLite software. I have understood the structure of SQLite
>> as described in the "Architecture of SQLite" manual.
>> I am now reading the document named "The Virtual Database Engine of
>> SQLite" which I got from the
>> SQLite site.
>> Currently i am working on Fedora 11 machine with SQLite version 3.6.20.
>> I have a doubt while reading the VDBE program.
>>
>> sqlite>  CREATE TABLE sample2(one char, two int, three float);
>> sqlite>  EXPLAIN INSERT INTO sample2 VALUES('Sen',685,87.6);
>>
>> addr  opcode p1p2p3 p4  p5  comment
>>  -  -
>> ---
>> 0 Trace 0  0  000
>> 1 Goto   0 11 000
>> 2 OpenWrite  0 3   03  00
>> 3 NewRowid  0 2   000
>> 4 String8   0 3   0Sen   00
>> 5 Integer   685  4   000
>> 6 Real   0 50   87.6   00
>> 7 MakeRecord   3 36   ade00
>> 8 Insert 0 62   sample2 1b
>> 9 Close  0 0000
>> 10Halt   0 0000
>> 11Transaction0 1000
>> 12VerifyCookie   0 4   000
>> 13TableLock  0 31   sample200
>> 14Goto  0 2000
>>
>> I have many doubts as the vdbe program structure is different from the
>> one explained in the document. The document is for SQLite 2.8.0.
>>
>> Now the area where i need more clarifications are :
>>
>> * OpenWrite
>> * MakeRecord
>> * Stack operations happening when you do a MakeRecord
>> * NewRowid
>> * Insert
>> * TableLock
>>
>> I would like to know the function of each operands in the above stated
>> cases and the related stack operations.
>>
>>
>> --
>> Regards,
>> *Navaneeth Sen B.*
>>
>> ___
>> 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] Reading the VDBE program

2010-03-23 Thread Pavel Ivanov
Just out of curiosity: what are you need it for? Do you think that
it's necessary to use SQLite properly?

Pavel

On Tue, Mar 23, 2010 at 8:01 AM, Navaneeth Sen B
 wrote:
> Hello all,
>
> I am new to SQLite software. I have understood the structure of SQLite
> as described in the "Architecture of SQLite" manual.
> I am now reading the document named "The Virtual Database Engine of
> SQLite" which I got from the
> SQLite site.
> Currently i am working on Fedora 11 machine with SQLite version 3.6.20.
> I have a doubt while reading the VDBE program.
>
> sqlite> CREATE TABLE sample2(one char, two int, three float);
> sqlite> EXPLAIN INSERT INTO sample2 VALUES('Sen',685,87.6);
>
> addr  opcode         p1    p2    p3     p4              p5  comment
>      -                  -
> --    -
> 0     Trace             0      0      0                        00
> 1     Goto               0     11     0                        00
> 2     OpenWrite      0     3       0        3              00
> 3     NewRowid      0     2       0                        00
> 4     String8           0     3       0        Sen           00
> 5     Integer           685  4       0                        00
> 6     Real               0     5        0       87.6           00
> 7     MakeRecord   3     3        6       ade            00
> 8     Insert             0     6        2       sample2     1b
> 9     Close              0     0        0                        00
> 10    Halt               0     0        0                        00
> 11    Transaction    0     1        0                        00
> 12    VerifyCookie   0     4       0                        00
> 13    TableLock      0     3        1       sample2    00
> 14    Goto              0     2        0                        00
>
> I have many doubts as the vdbe program structure is different from the
> one explained in the document. The document is for SQLite 2.8.0.
>
> Now the area where i need more clarifications are :
>
>    * OpenWrite
>    * MakeRecord
>    * Stack operations happening when you do a MakeRecord
>    * NewRowid
>    * Insert
>    * TableLock
>
> I would like to know the function of each operands in the above stated
> cases and the related stack operations.
>
>
> --
> Regards,
> *Navaneeth Sen B.*
>
> ___
> 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] Reading the VDBE program

2010-03-23 Thread Navaneeth Sen B
Hello all,

I am new to SQLite software. I have understood the structure of SQLite 
as described in the "Architecture of SQLite" manual.
I am now reading the document named "The Virtual Database Engine of 
SQLite" which I got from the
SQLite site.
Currently i am working on Fedora 11 machine with SQLite version 3.6.20.
I have a doubt while reading the VDBE program.

sqlite> CREATE TABLE sample2(one char, two int, three float);
sqlite> EXPLAIN INSERT INTO sample2 VALUES('Sen',685,87.6);

addr  opcode p1p2p3 p4  p5  comment
 -  - 
---
0 Trace 0  0  000
1 Goto   0 11 000
2 OpenWrite  0 3   03  00
3 NewRowid  0 2   000
4 String8   0 3   0Sen   00
5 Integer   685  4   000
6 Real   0 50   87.6   00
7 MakeRecord   3 36   ade00
8 Insert 0 62   sample2 1b
9 Close  0 0000
10Halt   0 0000
11Transaction0 1000
12VerifyCookie   0 4   000
13TableLock  0 31   sample200
14Goto  0 2000

I have many doubts as the vdbe program structure is different from the 
one explained in the document. The document is for SQLite 2.8.0.

Now the area where i need more clarifications are :

* OpenWrite
* MakeRecord
* Stack operations happening when you do a MakeRecord
* NewRowid
* Insert
* TableLock

I would like to know the function of each operands in the above stated 
cases and the related stack operations.


-- 
Regards,
*Navaneeth Sen B.*

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


Re: [sqlite] Porting Sqlite to MQX OS: Question 3

2010-03-23 Thread Pavel Ivanov
If task 1 will have only one connection to customer.db and task 2 will
have only one connection to fault.db then it looks like you don't need
any locking indeed. And most part of mutexes is not necessary too,
although probably you'll need ones that protect some global variables
(can't say how many of these is there).

Pavel

On Mon, Mar 22, 2010 at 8:09 AM, GeoffW  wrote:
>
> Hello
>
> I am still working away at this porting exercise, I have a couple of general
> questions please that I would value some comments on.
>
> The absence of a file locking mechanism in MQX means the best I can do is a
> "dot lock" type locking strategy. I have implemented this now, but what is
> concerning me is the amount of extra file opening and closing it is creating
> in addition to the actual accessing of the database. In my embedded system I
> am using NOR flash which has a limited write cycle life. I dont really have
> a good feel as to what amount of extra flash write overhead I am causing, is
> there an easy way to roughly estimate this ?
>
> If this really is an issue then I have no option other than to have no file
> locking. This might be acceptable in our typical application, I just need to
> make sure I understand the limitations.
>
> Lets say for the sake of an example, I have an Application made up of 10
> tasks. Task 1 and only task 1 can access a customer.db database file. Task 2
> and only task 2 can access say a fault logging database fault.db.
>
> Are these 2 statement correct for the above situation ?
>
> 1) This will work fine with no file locking.
>
> 2) I must make sure that I have implemented the mutex system to allow me to
> define SQLITE_THREADSAFE.
>
> Just wanted to sanity check my understanding of the concepts here.
>
> Thanks Geoff
>
>
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://old.nabble.com/Porting-Sqlite-to-MQX-OS%3A-Question-3-tp27985475p27985475.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> 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] INSERT failing.

2010-03-23 Thread Paul Corke
> unrecognized token: ""Man weiss es nicht, aber es war ein Feiertag.")"

The character after the . is not a double-quote, plus you should be
using single quotes anyway.

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


Re: [sqlite] suggestion - make pragma case_sensitive_like queryable

2010-03-23 Thread Simon Davies
On 22 March 2010 21:53, Bogdan Ureche  wrote:
> The pragma case_sensitive_like is not queryable, unlike other pragmas. Is
> there any reason why it's not?
>
> If not, I would like to suggest to be made queryable, for consistency.
>
> Bogdan

The setting is detectable:

sqlite>
sqlite> select 'a' like 'A';
1
sqlite> pragma case_sensitive_like=1;
sqlite>
sqlite> select 'a' like 'A';
0
sqlite>

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