[sqlite] Query Execution in SQLite

2008-06-09 Thread sqlite
Dear All, We are using SQLite for our application development which would be deployed in a pocket pc.Here we are using a inner join query which takes different time during different executions, the query which we using in our application is "SELECT DISTINCT MT.PcNo, MT.SubPcNo, MT.BrandNo,

Re: [sqlite] How to build an extension that gets autoloaded

2008-06-09 Thread Shane Harrelson
If you just need the rtree extension, I believe it will be included by default in the next version of the core sqlite library. -Shane On Tue, Jun 10, 2008 at 12:39 AM, Stephen Woodbridge < [EMAIL PROTECTED]> wrote: > Hi all, > > I was reading through the sqlite source and noticed that there

Re: [sqlite] How to build an extension that gets autoloaded

2008-06-09 Thread P Kishor
Greetings Steve, On 6/9/08, Stephen Woodbridge <[EMAIL PROTECTED]> wrote: > Hi all, > > I was reading through the sqlite source and noticed that there appears > to be an ability to build and extension that is statically linked and > autoloaded, but I can not find any details on how to do

[sqlite] How to build an extension that gets autoloaded

2008-06-09 Thread Stephen Woodbridge
Hi all, I was reading through the sqlite source and noticed that there appears to be an ability to build and extension that is statically linked and autoloaded, but I can not find any details on how to do this. For example, if I want to build an application that uses the rtree extension on

Re: [sqlite] Writing double into a socket file

2008-06-09 Thread Peter A. Friend
Alex Katebi wrote: > I am trying to implement remote procedure calls (RPC) for SQLite API to be > used in my application. > In particular sqlite3_column_double( ) returns a floating point double. > How can I write this double value into a TCP socket? > I have tried writing 8 bytes as integer

Re: [sqlite] Writing double into a socket file

2008-06-09 Thread D. Richard Hipp
On Jun 9, 2008, at 9:58 PM, Russell Leighton wrote: > > On Jun 9, 2008, at 8:52 PM, Igor Tandetnik wrote: > >> "Alex Katebi" <[EMAIL PROTECTED]> >> wrote in message >> news:[EMAIL PROTECTED] >>> I am trying to implement remote procedure calls (RPC) for SQLite API >>> to be used in my

Re: [sqlite] Writing double into a socket file

2008-06-09 Thread Teg
Hello Alex, How about a text representation? CSV over the network using the HTTP protocol or something like that. C Monday, June 9, 2008, 8:40:39 PM, you wrote: AK> I am trying to implement remote procedure calls (RPC) for SQLite API to be AK> used in my application. AK> In particular

Re: [sqlite] Writing double into a socket file

2008-06-09 Thread Russell Leighton
On Jun 9, 2008, at 8:52 PM, Igor Tandetnik wrote: > "Alex Katebi" <[EMAIL PROTECTED]> > wrote in message > news:[EMAIL PROTECTED] >> I am trying to implement remote procedure calls (RPC) for SQLite API >> to be used in my application. >> In particular sqlite3_column_double( ) returns a floating

Re: [sqlite] Writing double into a socket file

2008-06-09 Thread Igor Tandetnik
"Alex Katebi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying to implement remote procedure calls (RPC) for SQLite API > to be used in my application. > In particular sqlite3_column_double( ) returns a floating point > double. How can I write this double value into a TCP

[sqlite] Writing double into a socket file

2008-06-09 Thread Alex Katebi
I am trying to implement remote procedure calls (RPC) for SQLite API to be used in my application. In particular sqlite3_column_double( ) returns a floating point double. How can I write this double value into a TCP socket? I have tried writing 8 bytes as integer values but the received valued at

Re: [sqlite] prepare peformances

2008-06-09 Thread Dennis Cote
Bruce Robertson wrote: > Thanks, but I'm gonna need some further instruction or examples or pointers > to a resource as none of these statements mean anything to me. > I also posted some sample code that is equivalent to the old sample code at http://www.sqlite.org/quickstart.html which still

Re: [sqlite] prepare peformances

2008-06-09 Thread Dennis Cote
Bruce Robertson wrote: > Thanks, but I'm gonna need some further instruction or examples or pointers > to a resource as none of these statements mean anything to me. > Try reading this http://www.sqlite.org/cintro.html and see if it makes more sense after that. HTH Dennis Cote

Re: [sqlite] prepare peformances

2008-06-09 Thread Jay A. Kreibich
On Mon, Jun 09, 2008 at 03:39:01PM -0700, Bruce Robertson scratched on the wall: > Thanks, but I'm gonna need some further instruction or examples or pointers > to a resource as none of these statements mean anything to me. These are C API function calls. If you're not using the C API, none

Re: [sqlite] prepare peformances

2008-06-09 Thread Bruce Robertson
Thanks, but I'm gonna need some further instruction or examples or pointers to a resource as none of these statements mean anything to me. > Use this sequence: > > sqlite3_open > sqlite3_prepare_v2//Compiles SQL statement > > loop > sqlite3_bind... //Binds variables > >

Re: [sqlite] Select problem with equal compare

2008-06-09 Thread John Stanton
Alexey Pechnikov wrote: > В сообщении от Monday 09 June 2008 17:52:24 Dennis Cote написал(а): > >>If you >>consider dates to be equal when the two dates are the same to within one >>second, then you could use that value as your maximum difference. Since >>a julian day number has units of days,

Re: [sqlite] prepare peformances

2008-06-09 Thread Bruce Robertson
Can somebody point me to documentation or examples of sqlite prepare statements and their purose? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] graph question

2008-06-09 Thread David Baird
On Mon, Jun 9, 2008 at 3:49 PM, Bruce Robertson <[EMAIL PROTECTED]> wrote: >> select f || ' ' || group_concat(t, ' ') >> from w >> where f in (1, 2, 3); >> group by f; >> >> HTH >> Dennis > > Can you explain that? > > What's the || ' ' || part? || is the string concat operator. e.g.

Re: [sqlite] graph question

2008-06-09 Thread Bruce Robertson
> David Baird wrote: >> >> Okay, just built SQLite 3.5.9 and group_concat does in fact work: >> >> select group_concat(t, ' ') from w where f=1; > > You forgot the parent value at the beginning. Also, the OP may want to > do this for several parents which can be accomplished by grouping the

Re: [sqlite] Select problem with equal compare

2008-06-09 Thread Alexey Pechnikov
В сообщении от Monday 09 June 2008 17:52:24 Dennis Cote написал(а): > If you > consider dates to be equal when the two dates are the same to within one > second, then you could use that value as your maximum difference. Since > a julian day number has units of days, you can use a value of 1/86400

Re: [sqlite] rtree extension question

2008-06-09 Thread Shane Harrelson
Each pair of columns (min/max) represents one dimension. So for latitude/longitude coordinates you would have 5 columns: 1 id column and 2 columns each for latitude and longitude. 5 "columns" equates to 2 dimensions of data. 7 "columns" equates to 3 dimensions of data. Etc. HTH. -Shane On

Re: [sqlite] rtree extension question

2008-06-09 Thread Christophe Leske
> You can improve performance (space/speed) a little by changing the > RTREE_MAX_DIMENSIONS at the top of rtree.c to match you data set. It > defaults to 5 dimensions, but you could reduce to this to 2, or 3 with city > size. > > #define RTREE_MAX_DIMENSIONS 5 > Hi Shane, thanks for the

Re: [sqlite] graph question

2008-06-09 Thread Wilson, Ron P
sqlite>select level from sqlGuruOMeter where name="Ron Wilson"; 2 Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilson, Ron P Sent: Monday, June 09, 2008 1:49 PM To: General

Re: [sqlite] graph question

2008-06-09 Thread David Baird
On Mon, Jun 9, 2008 at 11:40 AM, Dennis Cote <[EMAIL PROTECTED]> wrote: > David Baird wrote: >> >> Okay, just built SQLite 3.5.9 and group_concat does in fact work: >> >> select group_concat(t, ' ') from w where f=1; > > You forgot the parent value at the beginning. Also, the OP may want to >

Re: [sqlite] graph question

2008-06-09 Thread Wilson, Ron P
Wicked. Thanks David and Dennis! And this works like a charm for all parents: select f || ' ' || group_concat(t, ' ') from w group by f; This pushes me up to a '2' on the SQL Guru Meter. RW SQLGuru-O-Meter |0-+--510| Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453

Re: [sqlite] graph question

2008-06-09 Thread Wilson, Ron P
Yes. I have been lurking here long enough to hear that response 100x - and it is a fair answer. Thanks! RW Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik Sent:

Re: [sqlite] graph question

2008-06-09 Thread Dennis Cote
David Baird wrote: > > Okay, just built SQLite 3.5.9 and group_concat does in fact work: > > select group_concat(t, ' ') from w where f=1; You forgot the parent value at the beginning. Also, the OP may want to do this for several parents which can be accomplished by grouping the results.

Re: [sqlite] graph question

2008-06-09 Thread David Baird
On Mon, Jun 9, 2008 at 11:19 AM, David Baird <[EMAIL PROTECTED]> wrote: > On Mon, Jun 9, 2008 at 11:09 AM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: >> Wilson, Ron P >> <[EMAIL PROTECTED]> >> wrote: >>> select t from w where f=1; >>> 2 >>> 3 >>> 4 >>> 5 >>> 6 >>> 7 >>> >>> I would like the output

Re: [sqlite] rtree extension question

2008-06-09 Thread Shane Harrelson
You can improve performance (space/speed) a little by changing the RTREE_MAX_DIMENSIONS at the top of rtree.c to match you data set. It defaults to 5 dimensions, but you could reduce to this to 2, or 3 with city size. #define RTREE_MAX_DIMENSIONS 5 -Shane On 6/9/08, Dennis Cote <[EMAIL

Re: [sqlite] graph question

2008-06-09 Thread David Baird
On Mon, Jun 9, 2008 at 11:09 AM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > Wilson, Ron P > <[EMAIL PROTECTED]> > wrote: >> select t from w where f=1; >> 2 >> 3 >> 4 >> 5 >> 6 >> 7 >> >> I would like the output to look like this: >> >> 1 2 3 4 5 6 7 >> >> i.e. parent child1 child2 ... childN > >

Re: [sqlite] graph question

2008-06-09 Thread Igor Tandetnik
Wilson, Ron P <[EMAIL PROTECTED]> wrote: > select t from w where f=1; > 2 > 3 > 4 > 5 > 6 > 7 > > I would like the output to look like this: > > 1 2 3 4 5 6 7 > > i.e. parent child1 child2 ... childN SQL is not formatting or reporting library. It gives you raw data, and it's up to your

[sqlite] graph question

2008-06-09 Thread Wilson, Ron P
Given the following: create table w (f, t); begin; insert into w (f, t) values (1, 2); insert into w (f, t) values (1, 3); insert into w (f, t) values (1, 4); insert into w (f, t) values (1, 5); insert into w (f, t) values (1, 6); insert into w (f, t) values (1, 7); ... commit; select t from w

Re: [sqlite] prepare peformances

2008-06-09 Thread Eric Minbiole
> I would expect that sqlite3_prepare would be faster in such a case, and > maybe Toms is pointing out a circumstance where recreating the query > seems to be faster. Or am I misreading the post? One possible explanation (stab in the dark): If many of the bound parameters are text (or blob)

Re: [sqlite] prepare peformances

2008-06-09 Thread John Elrick
Chiming in a thought, but isn't there a subtle difference between the two? As I am reading Toms post, sqlite3_prepare would be called once and the parameters would be bound up to 384 times The call to sqlite3_exec should finalize the prepared query and re-prepare it 384 times. I would expect

Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread flakpit
Dennis Cote wrote: > > flakpit wrote: > > You could try > >select distinct category, subcategory >from documents >order by category, subcategory; > > Then your application can do the display formatting, such as suppressing > the display of the category when it is the same as

Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread Dennis Cote
flakpit wrote: > > There may be thousands of category and subcategory duplications as they are > not the primary record identifier. > > I.e. A record has a category of "Manuals" and a subcategory "Audio" > Another record has a category of "Manuals" and a subcategory "Phone" > A

Re: [sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread Simon Davies
Hi Gary, Does SELECT DISTINCT category, subcategory from documents; not provide what you want? If not you may need to be more specific. Rgds, Simon ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] importing text or text-delimited file

2008-06-09 Thread Christopher F. Martin
On Mon, 9 Jun 2008, Francesco Pietra wrote: > [EMAIL PROTECTED]:~/sqlite$ sqlite biology_text.txt (text file) This in incorrect syntax. You cannot import text or other data when invoking sqlite. You need to invoke sqlite with the name of a new or existing sqlite database, then import your data

Re: [sqlite] prepare peformances

2008-06-09 Thread John Stanton
Sqlite3_exec just encapsulates sqlite3_prepare. You very likely have something wrong with your code if yor version works slower. toms wrote: > Hi all > I tried to use the sqlite3_prepare to increase my performances during > requests for both writing / reading. > The strange thing is that when

[sqlite] prepare peformances

2008-06-09 Thread toms
Hi all I tried to use the sqlite3_prepare to increase my performances during requests for both writing / reading. The strange thing is that when using prepare on a request used many times with many parameters (many times = 384 max, many parameters = 15) it os slower than simply using the

[sqlite] Extracting distinct category and subcategory pairs

2008-06-09 Thread flakpit
Hello, due to the wonderful help that I have recieved before, I dare to ask "I have records in a database with Category and Subcategory fields. How would I formulate the query to return distinct results and return for whatever I need to do with them?" There may be thousands of category and

Re: [sqlite] rtree extension question

2008-06-09 Thread Dennis Cote
Christophe Leske wrote: > > - one can somehow index the fields of an rtree table, and if so how? > - if there could be any other information in an rtree table other than > the integer ID and then the real values for the rectangles. > > The reason i am asking for this is because this yields to

Re: [sqlite] Select problem with equal compare

2008-06-09 Thread Dennis Cote
Alexey Pechnikov wrote: > > and compare is right, but is this correct way for date values? > Yes, this is correct, or at least expected, for date values stored as floating point julian day numbers. The binary floating point values used are the best approximations to the decimal rational

[sqlite] importing text or text-delimited file

2008-06-09 Thread Francesco Pietra
Hi: To start with I installed sqlite 2.8.17 from Debain Linux lenny. I know about 3.5.9: I'll come to later. I am tired from using the database Asksam though the Windows emulator wine. At the moment it does not work. I had previously expoted thre Asksam files as text file text-delimited file