Re: [sqlite] sqlite-users Digest, Vol 20, Issue 72

2009-08-26 Thread Zhanjun You
>
> >I have read the article "
> > http://www.sqlite.org/fileformat.html#journal_file_formats"; and "
> > http://www.sqlite.org/fileformat.html#rollback_journal_method",but I
> > am even
> > more confused, anyone have some sample code for
> > rollback_journal_method.
>
> You do not handle rollbacks by calling functions yourself, you do it
> by issuing SQL commands.  Read
>
> http://www.sqlite.org/lang_savepoint.html
>
> ROLLBACK is a way to do something like 'undo' for SQL.  You cannot
> turn this functionality off and use it for your own purposes.
>
> Simon.
>
>
I just want to know how to use code to implement this, I can not search
anything code on the internet, so here for help.
Although I know mydb.db.journal file format, but how to make the data in the
journal file into the mydb.db, I do not know how to implement, my app
running environment is linux + c.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Index performance using 2 integers vs. 1 float

2009-08-26 Thread Simon Slavin

On 27 Aug 2009, at 3:21am, danjenkins wrote:

> We use a julian.decimal format to represent date/time (i.e. noon of  
> August
> 26, 2009 would be 40049.5000) and we use this julian date for an  
> index key.
> Our databases are frequently up to 3GB in size containing 10 million  
> records
> with 15 assorted field types per record and contain 6 months of  
> data.  I'm
> proposing to break up the julian.date into two separate integers for  
> the
> data and time and index off the date integer.
>
> Of course this change will give queries some sort of a speed boost,  
> but by
> how much would you think?

We can't give you much idea because the answer depends too much on  
your data and what you're SELECTing on.  I can only suggest you try  
it.  Create the other column and an index on it without deleting your  
existing column or index.  Write some code that does 100,000 SELECTs  
of the type you need using each index, and compare the total times.   
Whichever one loses gets killed.

WHERE and ORDER BY times will depend on how 'clumpy' the dates in the  
table are.  For instance, if almost everything happens on the 15th of  
the month, you'll have only 1/30th as many different values as you'd  
have if things happened on random days including weekends.  Having  
1/30th as many distinct values changes the amount of searching and  
sorting that needs to be done dramatically.

Another aspect is which fields you need to retrieve when you do your  
SELECT.  If your select needs to retrieve the time field, and the time  
field doesn't appear in the index it's using, it will need to read the  
time from the record too.  So that would increase the amount of time  
taken for retrieval.

And lastly, of course, sorting on INTEGERs is a little quicker than  
sorting on REALs.  And there are a few other considerations about  
handing and passing integers as opposed to floating-point numbers.

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


Re: [sqlite] Index performance using 2 integers vs. 1 float

2009-08-26 Thread P Kishor
On Wed, Aug 26, 2009 at 9:21 PM, danjenkins wrote:
>
> Hello,
> We use a julian.decimal format to represent date/time (i.e. noon of August
> 26, 2009 would be 40049.5000) and we use this julian date for an index key.
> Our databases are frequently up to 3GB in size containing 10 million records
> with 15 assorted field types per record and contain 6 months of data.  I'm
> proposing to break up the julian.date into two separate integers for the
> data and time and index off the date integer.
>
> Of course this change will give queries some sort of a speed boost, but by
> how much would you think?


These kind of queries are asked often on the list, and they always
puzzle me. At the most, one of the sql experts here can tell you
whether or not a particular index will be used or how to better
formulate a query, but when it comes to figuring out by how much would
a particular query be faster by... well, you are the only one in this
world best placed to answer that question. You know the hardware, the
other processes running concurrently, you have the data. Just write a
little benchmark program and measure it. That way you will have the
most reliable answer. Anyone else's answer will just be pointless
guesswork. Remember, assertions are politics... backing them up with
evidence is science.

..

-- 
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
===
Sent from Madison, WI, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Index performance using 2 integers vs. 1 float

2009-08-26 Thread danjenkins

Hello,
We use a julian.decimal format to represent date/time (i.e. noon of August
26, 2009 would be 40049.5000) and we use this julian date for an index key. 
Our databases are frequently up to 3GB in size containing 10 million records
with 15 assorted field types per record and contain 6 months of data.  I'm
proposing to break up the julian.date into two separate integers for the
data and time and index off the date integer.

Of course this change will give queries some sort of a speed boost, but by
how much would you think?  

Many thanks,
Dan

-- 
View this message in context: 
http://www.nabble.com/Index-performance-using-2-integers-vs.-1-float-tp25165036p25165036.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


Re: [sqlite] Trouble running sqlite3 in ubuntu linux 9.04

2009-08-26 Thread D. Richard Hipp

On Aug 26, 2009, at 8:09 PM, Paul Whipp wrote:

> Thanks for the reply Robert. It helps to know that it 'should' work.
>
> I get exactly the same result as you from "dpkg -l sqlite3"
>
> I uninstalled (aptitude purge sqlite3) and reinstalled and got  
> exactly the
> same segmentation fault.
>
> Clearly, as its working on your system and not on mine there must be
> something in the dependencies causing the issue. Nothing on my system
> appears broken that is likely to relate to this so I'm stumped on  
> where to
> look next.
>
> I use firefox which creates and manages sqlite files for its cookies  
> etc.
> too making this doubly strange.
>
> Does anyone know what I should investigate or where I should look  
> next to
> solve this problem?
>

Go to the website and download three source files (all conveniently  
packaged in a tarball on the download page):

 sqlite3.c
 sqlite3.h
 shell.c

Then run:

 gcc -static -o sqlite3 -DSQLITE_THREADSAFE=0 sqlite3.c shell.c -ldl

Then move the resulting stand-alone, dependency-free executable  
"sqlite3" to someplace on your $PATH.


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] Trouble running sqlite3 in ubuntu linux 9.04

2009-08-26 Thread Paul Whipp
Thanks for the reply Robert. It helps to know that it 'should' work.

I get exactly the same result as you from "dpkg -l sqlite3"

I uninstalled (aptitude purge sqlite3) and reinstalled and got exactly the
same segmentation fault.

Clearly, as its working on your system and not on mine there must be
something in the dependencies causing the issue. Nothing on my system
appears broken that is likely to relate to this so I'm stumped on where to
look next.

I use firefox which creates and manages sqlite files for its cookies etc.
too making this doubly strange.

Does anyone know what I should investigate or where I should look next to
solve this problem?

Regards,
Paul Whipp
www.paulwhippconsulting.com.au
Tel: +61 410 545 357
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread BareFeet
Hi Matt,

> It appears to open, but it just spits out another compressed file,  
> over and over -- like a cruel Matryoshka doll on my desktop.
>
> The file in question: http://www.sqlite.org/sqlite3-3.6.17-osx-x86.bin.gz

Yes, it is annoying. I've mentioned the problem here before. I think  
DRH said he'd fix this, but I guess hasn't yet. The .gz file  
decompresses OK into a .bin file. But this name extension implies a  
MacBinary file, which the Mac attempts to decompress again, and again.

Once you've decompressed the .gz file, just rename the .bin file to  
"sqlite3", set execute permission (if not already) and move it to /usr/ 
local/bin/sqlite3.

Tom
BareFeet

  --
Comparison of SQLite GUI applications:
http://www.tandb.com.au/sqlite/compare/?ml



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


Re: [sqlite] [Delphi] Reading list of tables?

2009-08-26 Thread Kit
2009/8/27 Gilles Ganault :
> BTW, I noticed that "sqlite_master" has two columns that return the
> same thing: What is the difference between "name" and "tbl_name"?

It's different for indexes, wiews and triggers.
-- 
Kit
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [Delphi] Reading list of tables?

2009-08-26 Thread Gilles Ganault
On Thu, 13 Aug 2009 09:10:11 -0500, Fred Williams
 wrote:
>That's all you are suppose to get when querying the Master table for table
>names.
>
>You ask how to get a list of tables.  That is what you got.

Thanks. I only needed to get the list of tables in an SQLite database
file, and Simon's tip worked fine.

BTW, I noticed that "sqlite_master" has two columns that return the
same thing: What is the difference between "name" and "tbl_name"?

Thanks.

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


Re: [sqlite] Fixed size for auto-incremented primary key?

2009-08-26 Thread Gilles Ganault
On Sat, 8 Aug 2009 12:59:53 +0100, Simon Slavin
 wrote:
>Not to start from zero that way.  But you can create a record yourself  
>which has a barcode of
>
>11
>
>to force the number of digits, and from then SQLite will count up from  
>that one.  (Test this first, I haven't tried exactly that.)

Thanks guys, it worked. For those interested (Delphi):


SQL.Clear;
SQL.Add('CREATE TABLE IF NOT EXISTS mytable (id INTEGER PRIMARY KEY,
label VARCHAR)');
ExecSQL;

SQL.Clear;
SQL.Add('INSERT INTO mytable (id,label) VALUES (11,"my label");');
SQL.Add('INSERT INTO mytable (label) VALUES ("my label2")');
ExecSQL;


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


[sqlite] prayudinata...@gmail.com has invited you to have a 3D avatar chat

2009-08-26 Thread prayudinata

From: prayudinata   
   Avatar: Guest_prayudinata  To: Sqlite-users@sqlite.org   


 Hey Sqlite-users@sqlite.org,prayudinata has added you as a 
friend on IMVU.  Is prayudinata your friend?
  Yes  
 NoPlease respond or 
prayudinata may think you said no :)
  IMVU is the world's greatest 3D chat! 
   Dress up your Avatar with 3D clothes.
  Chat with your friends &
 ; meet new ones.  Decorate your own 3D Room with 
furniture.  FREE to download & use! 
   http://www.imvu.com  


Copyright © 2009 IMVU, Inc. 411 High Street, Palo Alto, CA 94301.  
This email was sent via IMVU by 
prayudinata (prayudinata...@gmail.com) to sqlite-us...@sqlite.org.  If you 
want to prevent any future emails from IMVU, you can remove yourself by 
pointing your web browser to 
http://www.imvu.com/catalog/web_nonregisteredoptout.php?code=1616cc&email=sqlite-us...@sqlite.org.
  Your unsubscribe confirmation code is 1616cc
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread Adam Swift

On Aug 26, 2009, at 7:03 AM, Simon Slavin wrote:

>
> On 26 Aug 2009, at 1:27pm, P Kishor wrote:
>
>> However, on a Mac you don't really want this. Just download the  
>> source
>> code at http://www.sqlite.org/sqlite-amalgamation-3.6.17.tar.gz,
>> gunzip it, run make, make install, and it will install all the bits
>> and bobs for you in the right place.
>
> Actually, on a Mac you might not need that either.  You will find
> sqlite already installed in various places including
>
> /usr/include/sqlite3.h
> /usr/include/sqlite3ext.h
> /usr/lib/libsqlite3.0.8.6.dylib
> /usr/lib/libsqlite3.0.dylib
> /usr/lib/libsqlite3.dylib
> /usr/lib/sqlite3
> /usr/lib/sqlite3/libtclsqlite3.dylib
> /usr/lib/sqlite3/pkgIndex.tcl
> /usr/share/man/man1/sqlite3.1.gz
>
> unless you specifically need a later version than 3.0.8.6 .  If you
> do, make sure your own installation does not overwrite the existing
> one since this may upset the various system components that use it.
>
Point of clarification - the sqlite shared library that comes  
preinstalled on a mac has 2 oddly _named_ variants:  
libsqlite3.0.8.6.dylib (a symlink) and libsqlite3.0.dylib (the actual  
library).  This is due to the way the sqlite autoconf/Makefile build  
resources are configured to name the library.  The actual version of  
the sqlite library installed on Mac OS X 10.5 (Leopard) is 3.4.0

If you don't _need_ access to newer features of sqlite for your  
application it is highly recommended that you use the pre-installed  
shared library since it has been qualified to work well with the  
hardware, file systems and operating systems supported by the mac.

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


[sqlite] SELECT statement causing exclusive lock?

2009-08-26 Thread Boucher, Michael
Hi folks,

 

I've got a problem which has been confusing me for a few days, so its
time to ask the list for some insight.

 

I've got an application where there are two threads each reading from
distinct tables in the database.  In the main thread, there is a SELECT
statement which returns a lot of rows (500K or so) executing.  The 2nd
thread executes a SELECT from a different table.  Sometimes, both of
these threads are running simultaneously, which shouldn't be a problem
since these are both SELECT statements, both should be able to run and
return data (there should be a shared lock).

 

The problem I'm having is that the 2nd thread is getting the SQLite
error 5, "database is locked", and I can't figure out why that would be
the case.

 

Looking at my log file, The first SELECT has done the prepare, and it's
going through a "fetch loop" (using step) reading the results into a
memory hash, but the transaction hasn't been committed yet.  The 2nd one
tries to execute, waits a while via the busy handler, and eventually
gives up.  Here's a snippet of my application log which shows the
problem:

 

[DEBUG][Lib.Agent.DB.Transactions][19:59:20][1000] -
CAgentDBTransactionGuard::c'tor Starting Transaction...

[DEBUG][Lib.Agent.DB.Transactions][19:59:20][1000] -
CAgentLiteDBTransaction::Start -- BEGIN TRANSACTION
BuildPreviousRevisionCache

[DEBUG][Lib.Agent.DB.Statements][19:59:20][1000] -   SELECT PN.Name AS
PathName, FN.Name AS FileName FROM FileName FN  INNER JOIN PathName PN
ON FN.PathID=PN.PathID;

[DEBUG][Lib.Agent.DB.Performance][19:59:20][1000] - Execution took 0.18
seconds.

[DEBUG][Lib.Agent.DB.Transactions][20:03:05][9720] -
CAgentDBTransactionGuard::c'tor Starting Transaction...

[DEBUG][Lib.Agent.DB.Transactions][20:03:05][9720] -
CAgentLiteDBTransaction::Start -- BEGIN TRANSACTION GetLatestLogInfo

[DEBUG][Lib.Agent.DB.Performance][20:03:05][9720] - Prepare took 0.00
seconds.

[DEBUG][Lib.Agent.DB.Statements][20:03:05][9720] -   SELECT  TrueName,
Source, LogType, StartTime, EndTime, Status, Description FROM AgentLogs
WHERE EndTime IS NOT NULL AND LogType = 0 ORDER BY EndTime DESC LIMIT 1

[ERROR][Lib.Agent.DB.SQLite][20:04:07][9720] - Sqlite Error Code: 5

[ERROR][Lib.Agent.DB.SQLite][20:04:07][9720] - Sqlite Error: database is
locked

 

brief explanation on the log: the "execution took..." like after the
select statement tells me that the first row is returned in that amount
of time.  After that, the next log message would be when we're done
fetching the rows and the transaction is committed.  The [1000] and
[9720] are thread IDs.  Also, in the time between 20:03:05: and
20:04:07, we retry the select many times via the busy handler, but give
up after a minute.

 

Any suggestions as to why the first SELECT would cause a lock?

 

Thanx!

 

Mike



Michael D. Boucher

Software Engineer - Connected Agent

Iron Mountain Digital

120 Turnpike Rd, Southboro, MA 01772

508-808-7590

 

michael.bouc...@ironmountain.com

 



The information contained in this email message and its attachments
is intended
only for the private and confidential use of the recipient(s) named
above, unless the sender expressly agrees otherwise. Transmission
of email over the Internet
 is not a secure communications medium. If you are requesting or
have requested
the transmittal of personal data, as defined in applicable privacy
laws by means
 of email or in an attachment to email you must select a more
secure alternate means of transmittal that supports your
obligations to protect such personal data. If the reader of this
message is not the intended recipient and/or you have received this
email in error, you must take no action based on the information in
this email and you are hereby notified that any dissemination,
misuse, copying, or disclosure of this communication is strictly
prohibited. If you have received
this communication in error, please notify us immediately by email
and delete the original message.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread Simon Slavin

On 26 Aug 2009, at 5:43pm, P Kishor wrote:

> Why would you want to use the factory installed stuff when installing
> your own and mucking around with your own version is so easy

Because you can give your resulting software to anyone else using a  
Mac and know any tools they have will be able to access the databases.

But yes, if you're just using your own software and manipulating your  
own data then it doesn't matter.

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


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread P Kishor
On Wed, Aug 26, 2009 at 9:03 AM, Simon
Slavin wrote:
>
> On 26 Aug 2009, at 1:27pm, P Kishor wrote:
>
>> However, on a Mac you don't really want this. Just download the source
>> code at http://www.sqlite.org/sqlite-amalgamation-3.6.17.tar.gz,
>> gunzip it, run make, make install, and it will install all the bits
>> and bobs for you in the right place.
>
> Actually, on a Mac you might not need that either.  You will find sqlite
> already installed in various places including
>
> /usr/include/sqlite3.h
> /usr/include/sqlite3ext.h
> /usr/lib/libsqlite3.0.8.6.dylib
> /usr/lib/libsqlite3.0.dylib
> /usr/lib/libsqlite3.dylib
> /usr/lib/sqlite3
> /usr/lib/sqlite3/libtclsqlite3.dylib
> /usr/lib/sqlite3/pkgIndex.tcl
> /usr/share/man/man1/sqlite3.1.gz
>
> unless you specifically need a later version than 3.0.8.6 .  If you do, make
> sure your own installation does not overwrite the existing one since this
> may upset the various system components that use it.
>


Why would you want to use the factory installed stuff when installing
your own and mucking around with your own version is so easy? If you
make, make install, your installed version will automatically go into
/usr/local/ without messing around with factory installed stuff.


-- 
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
===
Sent from Madison, WI, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread Simon Slavin

On 26 Aug 2009, at 1:27pm, P Kishor wrote:

> However, on a Mac you don't really want this. Just download the source
> code at http://www.sqlite.org/sqlite-amalgamation-3.6.17.tar.gz,
> gunzip it, run make, make install, and it will install all the bits
> and bobs for you in the right place.

Actually, on a Mac you might not need that either.  You will find  
sqlite already installed in various places including

/usr/include/sqlite3.h
/usr/include/sqlite3ext.h
/usr/lib/libsqlite3.0.8.6.dylib
/usr/lib/libsqlite3.0.dylib
/usr/lib/libsqlite3.dylib
/usr/lib/sqlite3
/usr/lib/sqlite3/libtclsqlite3.dylib
/usr/lib/sqlite3/pkgIndex.tcl
/usr/share/man/man1/sqlite3.1.gz

unless you specifically need a later version than 3.0.8.6 .  If you  
do, make sure your own installation does not overwrite the existing  
one since this may upset the various system components that use it.

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


Re: [sqlite] Write thread missing records during insertion

2009-08-26 Thread Simon Slavin

On 26 Aug 2009, at 12:18pm,   wrote:

> The observation is that when the permanent table population is  
> complete, I find there are some records that are missing.

Are you getting errors returned from the calls which write those  
records ?

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


Re: [sqlite] how to make journal file roll back to my database file?

2009-08-26 Thread Simon Slavin

On 26 Aug 2009, at 11:42am, Zhanjun You wrote:

>I have read the article "
> http://www.sqlite.org/fileformat.html#journal_file_formats"; and "
> http://www.sqlite.org/fileformat.html#rollback_journal_method",but I  
> am even
> more confused, anyone have some sample code for  
> rollback_journal_method.

You do not handle rollbacks by calling functions yourself, you do it  
by issuing SQL commands.  Read

http://www.sqlite.org/lang_savepoint.html

ROLLBACK is a way to do something like 'undo' for SQL.  You cannot  
turn this functionality off and use it for your own purposes.

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


Re: [sqlite] Regarding Memory Database

2009-08-26 Thread shankar m
I mean to say free to the OS so that it can use for other purpose.

SQlite frees but maintains to the memory will be present in SQLite memory
pool or heap. Not to the OS.

Regards
Shankar

On Wed, Aug 26, 2009 at 7:15 PM, Pavel Ivanov  wrote:

> > SQLite currently does not support freeing of allocated memory
> > unless it is shutdown.
>
> It seams to me that you're wrong in this conclusion or elaborate
> please how did you come to it.
> In fact SQLite always frees all memory related to connection
> (including cache) when you close it. And you can clearly see it in
> sources...
>
>
> Pavel
>
> On Wed, Aug 26, 2009 at 12:57 AM, shankar m
> wrote:
> > Hi,
> >
> > I am using SQLite in a embedded system which has the following databases
> >1. 64MB Flash stored Database for persistent storage
> >2. 2 MB In-Memory Database.
> >
> > When the Memory Database is closed the 2MB should be returned to the
> > operating system. The 2 MB will be reallocated when the system wants to
> use
> > the mem db. SQLite currently does not support freeing of allocated memory
> > unless it is shutdown.
> >
> >
> > To implement the above requirement I am planning to do as follows
> >
> > In SQLite Page cache module i.e pcahe1.c handles the datbase buffering of
> > both persistent storage and in-memory storage.
> > To identify whether the database is mem or file there is a flag
> bPurgeable
> > in struct PCache1.
> >
> > The pages for cache are allocated in functions
> >1. pcache1AllocPage
> >2. pcache1FreePage
> >
> > Add 2 new configuration variables
> >   1. SQLITE_CONFIG_MEMDB - Enables separate memory DB with the default
> > values
> >   2. SQLITE_CONFIG_MEMSIZE- Configures the mem db with user specified
> > memory block. Similar to the config variable
> >  SQLITE_CONFIG_PAGECACHE
> >
> > Using bPurgeable in pcache1AllocPage identify the mem db, If memdb then
> use
> > the mem block specified by the user.
> > The algorithm for the page allocation will be same as the list
> > implementation present for the SQLITE_CONFIG_PAGECACHE
> >
> > Please provide comments or suggestion.
> >
> > Thanks
> > Shankar
> > ___
> > 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] Regarding Memory Database

2009-08-26 Thread Pavel Ivanov
And I mean that you're wrong in this vision. SQLite doesn't keep
memory in pools if it doesn't belong to cache necessary to some open
connection. At least SQLite calls free() which of course doesn't
necessarily mean that memory will be returned to OS.


Pavel

On Wed, Aug 26, 2009 at 10:02 AM, shankar m wrote:
> I mean to say free to the OS so that it can use for other purpose.
>
> SQlite frees but maintains to the memory will be present in SQLite memory
> pool or heap. Not to the OS.
>
> Regards
> Shankar
>
> On Wed, Aug 26, 2009 at 7:15 PM, Pavel Ivanov  wrote:
>
>> > SQLite currently does not support freeing of allocated memory
>> > unless it is shutdown.
>>
>> It seams to me that you're wrong in this conclusion or elaborate
>> please how did you come to it.
>> In fact SQLite always frees all memory related to connection
>> (including cache) when you close it. And you can clearly see it in
>> sources...
>>
>>
>> Pavel
>>
>> On Wed, Aug 26, 2009 at 12:57 AM, shankar m
>> wrote:
>> > Hi,
>> >
>> > I am using SQLite in a embedded system which has the following databases
>> >    1. 64MB Flash stored Database for persistent storage
>> >    2. 2 MB In-Memory Database.
>> >
>> > When the Memory Database is closed the 2MB should be returned to the
>> > operating system. The 2 MB will be reallocated when the system wants to
>> use
>> > the mem db. SQLite currently does not support freeing of allocated memory
>> > unless it is shutdown.
>> >
>> >
>> > To implement the above requirement I am planning to do as follows
>> >
>> > In SQLite Page cache module i.e pcahe1.c handles the datbase buffering of
>> > both persistent storage and in-memory storage.
>> > To identify whether the database is mem or file there is a flag
>> bPurgeable
>> > in struct PCache1.
>> >
>> > The pages for cache are allocated in functions
>> >    1. pcache1AllocPage
>> >    2. pcache1FreePage
>> >
>> > Add 2 new configuration variables
>> >   1. SQLITE_CONFIG_MEMDB - Enables separate memory DB with the default
>> > values
>> >   2. SQLITE_CONFIG_MEMSIZE- Configures the mem db with user specified
>> > memory block. Similar to the config variable
>> >      SQLITE_CONFIG_PAGECACHE
>> >
>> > Using bPurgeable in pcache1AllocPage identify the mem db, If memdb then
>> use
>> > the mem block specified by the user.
>> > The algorithm for the page allocation will be same as the list
>> > implementation present for the SQLITE_CONFIG_PAGECACHE
>> >
>> > Please provide comments or suggestion.
>> >
>> > Thanks
>> > Shankar
>> > ___
>> > 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] Regarding Memory Database

2009-08-26 Thread Pavel Ivanov
> SQLite currently does not support freeing of allocated memory
> unless it is shutdown.

It seams to me that you're wrong in this conclusion or elaborate
please how did you come to it.
In fact SQLite always frees all memory related to connection
(including cache) when you close it. And you can clearly see it in
sources...


Pavel

On Wed, Aug 26, 2009 at 12:57 AM, shankar m wrote:
> Hi,
>
> I am using SQLite in a embedded system which has the following databases
>    1. 64MB Flash stored Database for persistent storage
>    2. 2 MB In-Memory Database.
>
> When the Memory Database is closed the 2MB should be returned to the
> operating system. The 2 MB will be reallocated when the system wants to use
> the mem db. SQLite currently does not support freeing of allocated memory
> unless it is shutdown.
>
>
> To implement the above requirement I am planning to do as follows
>
> In SQLite Page cache module i.e pcahe1.c handles the datbase buffering of
> both persistent storage and in-memory storage.
> To identify whether the database is mem or file there is a flag bPurgeable
> in struct PCache1.
>
> The pages for cache are allocated in functions
>    1. pcache1AllocPage
>    2. pcache1FreePage
>
> Add 2 new configuration variables
>   1. SQLITE_CONFIG_MEMDB - Enables separate memory DB with the default
> values
>   2. SQLITE_CONFIG_MEMSIZE- Configures the mem db with user specified
> memory block. Similar to the config variable
>      SQLITE_CONFIG_PAGECACHE
>
> Using bPurgeable in pcache1AllocPage identify the mem db, If memdb then use
> the mem block specified by the user.
> The algorithm for the page allocation will be same as the list
> implementation present for the SQLITE_CONFIG_PAGECACHE
>
> Please provide comments or suggestion.
>
> Thanks
> Shankar
> ___
> 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] Write thread missing records during insertion

2009-08-26 Thread Pavel Ivanov
> Can some one please tell me whether it is possible that the read thread is 
> causing the write thread to miss inserting some records?

If you do not check for the result of executing INSERTs in write
thread and then blindly reset the statement then answer is yes. In
case if INSERT returned SQLITE_BUSY (or SQLITE_LOCKED in case if you
use shared cache) this row will be lost.


Pavel

On Wed, Aug 26, 2009 at 7:18 AM,  wrote:
> Hi,
>
> I am having two threads running say Thread-A and Thread-B. Thread-A is 
> populating a DB table with while Thread-B is trying to read
> from the same table. In side Thread-B , I am creating a temporary table based 
> on filtered queries made on the
> table which is getting populated by Thread-A. To make the query response fast 
> the creation of  the temporary table is done within a BEGIN-END Transaction.
>
> The observation is that when the permanent table population is complete, I 
> find there are some records that are missing.
> This does not happen when the Thread-B is not querying the table while it is 
> in the process of getting built.
>
> Can some one please tell me whether it is possible that the read thread is 
> causing the write thread to miss inserting some records?
>
> Thanks and Regards,
> Souvik
>
>
> 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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread John Machin
On 26/08/2009 5:47 AM, Matt Stiles wrote:
> Am I losing my mind, or is there something wrong with the bin.gz file on the
> download page? I've downloaded it several times, but I can't get it to open
> completely using Stuffit or the Mac archive utility. It appears to open, but
> it just spits out another compressed file, over and over -- like a cruel
> Matryoshka doll on my desktop.
> 
> The file in question: http://www.sqlite.org/sqlite3-3.6.17-osx-x86.bin.gz

I can open this on Windows XP with the "7-Zip" 3rd-party utility. As 
expected of a foo.bin.gz file, it decompresses to a foo.bin file. 7zip 
can even open that; it says there are a bunch of __TEXT__ things, some 
__DATA__ things, and 2 __IMPORT__ things ... looks superficially not 
unlike an executable to me.

Doesn't the Mac OS have a "gunzip" program? I have one from the mingw32 
project or similar collection of Windows ports of *x programs:

C:\installers>gunzip -l sqlite3-3.6.17-osx-x86.bin.gz
compressed  uncompr. ratio uncompressed_name
258707510012  49.2% sqlite3-3.6.17-osx-x86.bin

C:\installers>gunzip -tv sqlite3-3.6.17-osx-x86.bin.gz
sqlite3-3.6.17-osx-x86.bin.gz:   OK

C:\installers>gunzip -V
gunzip 1.2.4 (18 Aug 93)
Compilation options:
DIRENT SYS_UTIME STDC_HEADERS HAVE_UNISTD_H NO_CHOWN PROTO ASMV

So that's two independent witnesses to the file on the website being an 
OK gzip file, and one that the inner file appears to be an uncompressed 
executable.  How did you obtain it -- http or ftp? Have you checked the 
compressed file size (I have 258707 (see above))?

What version of OS X are you running?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread P Kishor
On Tue, Aug 25, 2009 at 2:47 PM, Matt Stiles wrote:
> Am I losing my mind, or is there something wrong with the bin.gz file on the
> download page? I've downloaded it several times, but I can't get it to open
> completely using Stuffit or the Mac archive utility. It appears to open, but
> it just spits out another compressed file, over and over -- like a cruel
> Matryoshka doll on my desktop.
>
> The file in question: http://www.sqlite.org/sqlite3-3.6.17-osx-x86.bin.gz
>

If you gunzip the above file, it will result in
sqlite3-3.6.17-osx-x86.bin. This is the sqlite3 shell program. If you
set its executable bit with 'chmod +x', you can run this file and get
sqlite3.

However, on a Mac you don't really want this. Just download the source
code at http://www.sqlite.org/sqlite-amalgamation-3.6.17.tar.gz,
gunzip it, run make, make install, and it will install all the bits
and bobs for you in the right place.


> Thanks in advance.
>
> Matt
>
> --
>
> Matt Stiles
> Reporter, Texas Tribune 
> Email: msti...@texastribune.org
> Mobile: 512.965.5197
> [image: Youtube] [image:
> Facebook][image:
> Twitter] 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
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
===
Sent from Madison, WI, United States
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Trouble running sqlite3 in ubuntu linux 9.04

2009-08-26 Thread Robert Citek
FWIW, I've been running sqlite3 on Ubuntu 9.04 for a while without
issue for several months.

$ cat /etc/issue.net
Ubuntu 9.04

$ dpkg -l sqlite3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name  Version
 Description
+++-=-=-==
ii  sqlite3   3.6.10-1ubuntu0.2
 A command line interface for SQLite 3

$ sqlite3 test.db
SQLite version 3.6.10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

And there doesn't seem to be anything mentioning segfaults on launchpad:

https://launchpad.net/ubuntu/jaunty/+source/sqlite3

My first guess would be to uninstall and then re-install the sqlite3
package, as possibly something got borked during the installation.
Beyond that, I'm not sure.

Good luck and let us know how things go.

Regards,
- Robert

On Wed, Aug 26, 2009 at 12:01 AM, Paul Whipp wrote:
> Hi there,
>
> I just installed sqlite3 using synaptic. Install went fine but:
>
> ~$ sqlite3 test.db
> Segmentation fault
>
> Can anyone point me to the relevant documentation/solution?
[
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to Select using results from other selects in a single SQlite querry statement ?

2009-08-26 Thread Igor Tandetnik
Atul_Vaidya wrote:
> Hi, I have three tables,
> 1. Table Entity_xdata containing following fields
>> Entity_id|Layer|grpuid|
>
> 2. Table, group_xdata_pipe containing following fields 
>> grpuid|LNV|
>
> 3. Table group_id_vs_reggappname containing following fields 
>> grpuid|reggappname|
>
> Now, I need to Fire a query to SQlite where in I get the list of all
> the distinct LNVs. Currently I achieve it by following two query
> commands as follows 
> SELECT DISTINCT Entity_xData.grpuid from Entity_xdata INNER JOIN
> group_id_vs_regappname ON(Entity_xdata.grpuid =
> group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname =
> 'CPD1')
> I get the grpuids using this command and then i use the grpuids that
> i get from this query, as an input to my next query, something like
> this ...
>
> SELECT DISTINCT Line_Number_View FROM (SELECT grpuid,line_number_view
> FROM group_xdata_pipe WHERE grpuid = '%s' ORDER BY grpuid ASC)ORDER BY
> Line_Number_View ASC",query_result[x])
>
> My question is
> Is it possible to combine both these querries into one ?

SELECT DISTINCT Line_Number_View
FROM group_xdata_pipe WHERE grpuid IN (
SELECT Entity_xData.grpuid
FROM Entity_xdata INNER JOIN group_id_vs_regappname ON (
Entity_xdata.grpuid = group_id_vs_regappname.grpuid AND
group_id_vs_regappname.reg_appname = 'CPD1')
)
ORDER BY Line_Number_View ASC;

Igor Tandetnik 



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


Re: [sqlite] how to Select using results from other selects in a single SQlite querry statement ?

2009-08-26 Thread Atul_Vaidya


Atul_Vaidya wrote:
> 
> 
> SELECT DISTINCT Entity_xData.grpuid from Entity_xdata INNER JOIN
> group_id_vs_regappname ON(Entity_xdata.grpuid =
> group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname =
> 'CPD1')
> I get the grpuids using this command and then i use the grpuids that i get
> from this query, as an input to my next query, something like this ...
> 
> SELECT DISTINCT Line_Number_View FROM (SELECT grpuid,line_number_view FROM
> group_xdata_pipe WHERE grpuid = '%s' ORDER BY grpuid ASC)ORDER BY
> Line_Number_View ASC",query_result[x])
> 
> My question is
> Is it possible to combine both these querries into one ? or in other words 
> How to Select using Result obtained from other Select statements ?
> Thanks in Advance,
> Atul
> 
atul.vai...@prototechsolutions.com
Hi,
  I was able to achieve this by using two INNER JOINS as follows 
Select DISTINCT group_xdata_pipe.Line_Number_View from group_xdata_pipe
INNER JOIN Entity_xData ON(group_xdata_pipe.grpuid =
Entity_xData.grpuid)INNER JOIN group_id_vs_regappname ON(Entity_xdata.grpuid
= group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname =
'CPD1')
Thanks, and any suggestions to this query are welcome, i am sure, there must
be some more elegant ways of doing this.
Regards,
Atul
-- 
View this message in context: 
http://www.nabble.com/how-to-Select-using-results-from-other-selects-in-a-single-SQlite-querry-statement---tp25149885p25151110.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] Trouble running sqlite3 in ubuntu linux 9.04

2009-08-26 Thread Paul Whipp
Hi there,

I just installed sqlite3 using synaptic. Install went fine but:

~$ sqlite3 test.db
Segmentation fault

Can anyone point me to the relevant documentation/solution?

Regards,
Paul Whipp
www.paulwhippconsulting.com.au
Tel: +61 410 545 357
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] trouble with precompiled binaries for MacOS X

2009-08-26 Thread Matt Stiles
Am I losing my mind, or is there something wrong with the bin.gz file on the
download page? I've downloaded it several times, but I can't get it to open
completely using Stuffit or the Mac archive utility. It appears to open, but
it just spits out another compressed file, over and over -- like a cruel
Matryoshka doll on my desktop.

The file in question: http://www.sqlite.org/sqlite3-3.6.17-osx-x86.bin.gz

Thanks in advance.

Matt

--

Matt Stiles
Reporter, Texas Tribune 
Email: msti...@texastribune.org
Mobile: 512.965.5197
[image: Youtube] [image:
Facebook][image:
Twitter] 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] datetime('now', 'utc') vs. CURRENT_TIMESTAMP

2009-08-26 Thread Wilson, Ronald
> According to http://www.sqlite.org/lang_datefunc.html datetime('now')
> returns date and time already as UTC. If you add 'utc' modifier then
> it makes datetime() think that it's your local time and convert it to
> 'utc' thus adding 4 hours (apparently you're in GMT -4 timezone).

Thanks.  I figured out this nuance late last night.  (Actually I'm in
GMT -5, but with daylight savings.)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Write thread missing records during insertion

2009-08-26 Thread souvik.datta
Hi,

I am having two threads running say Thread-A and Thread-B. Thread-A is 
populating a DB table with while Thread-B is trying to read
from the same table. In side Thread-B , I am creating a temporary table based 
on filtered queries made on the 
table which is getting populated by Thread-A. To make the query response fast 
the creation of  the temporary table is done within a BEGIN-END Transaction.

The observation is that when the permanent table population is complete, I find 
there are some records that are missing.
This does not happen when the Thread-B is not querying the table while it is in 
the process of getting built. 

Can some one please tell me whether it is possible that the read thread is 
causing the write thread to miss inserting some records?

Thanks and Regards,
Souvik


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] how to make journal file roll back to my database file?

2009-08-26 Thread Simon Davies
2009/8/26 Zhanjun You :
> hello all,
>        I have read the article "
> http://www.sqlite.org/fileformat.html#journal_file_formats"; and "
> http://www.sqlite.org/fileformat.html#rollback_journal_method",but I am even
> more confused, anyone have some sample code for rollback_journal_method.

>From http://www.sqlite.org/docs.html
"SQLite File Format
A description of the format used for SQLite database and journal
files, and other details required to create software to read and write
SQLite databases without using SQLite. "

Your subject line suggests that you are just concerned with rollback
from the journal, not writing your own SQLite file writer.

SQLite takes care of all the details for you. It will use the journal
should it be necessary to do so when it opens the database file.

See section 4.0 (Rollback) in http://www.sqlite.org/atomiccommit.html

>
> thanks.
>
> simon

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


[sqlite] how to make journal file roll back to my database file?

2009-08-26 Thread Zhanjun You
hello all,
I have read the article "
http://www.sqlite.org/fileformat.html#journal_file_formats"; and "
http://www.sqlite.org/fileformat.html#rollback_journal_method",but I am even
more confused, anyone have some sample code for rollback_journal_method.

thanks.

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


Re: [sqlite] loadable extension doesn't load

2009-08-26 Thread sub sk79
Thanks!

-SK

On Tue, Aug 25, 2009 at 8:09 PM, Roger Binns  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> sub sk79 wrote:
> > I followed the exact instructions (
> > http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions) on SQLite wiki
> for
> > loadable extensions and still have run into this issue.
> > Can someone help me here?
>
> The instructions are how to make a loadable extension in C, but you are
> using C++.
>
> > /home/sk/utils/sqlite/sqlite-3.6.17/half.so: undefined symbol:
> > sqlite3_extension_init
>
> You need to declare sqlite3_extension_init as extern "C".  If you do not
> then the name gets mangled according to normal C++ symbol mangling rules.
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkqUfT4ACgkQmOOfHg372QS/xQCfVwBrbNLGlX6/cliQiLDY2yrJ
> YvoAoMb7d+pA4KJauvBREa8CWfSkkSwB
> =tyLu
> -END PGP SIGNATURE-
> ___
> 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] how to Select using results from other selects in a single SQlite querry statement ?

2009-08-26 Thread Atul_Vaidya

Hi, I have three tables,
1. Table Entity_xdata containing following fields
|Entity_id|Layer|grpuid|

2. Table, group_xdata_pipe containing following fields 
|grpuid|LNV|

3. Table group_id_vs_reggappname containing following fields 
|grpuid|reggappname|

Now, I need to Fire a query to SQlite where in I get the list of all the
distinct LNVs. Currently I achieve it by following two query commands as
follows 
SELECT DISTINCT Entity_xData.grpuid from Entity_xdata INNER JOIN
group_id_vs_regappname ON(Entity_xdata.grpuid =
group_id_vs_regappname.grpuid AND group_id_vs_regappname.reg_appname =
'CPD1')
I get the grpuids using this command and then i use the grpuids that i get
from this query, as an input to my next query, something like this ...

SELECT DISTINCT Line_Number_View FROM (SELECT grpuid,line_number_view FROM
group_xdata_pipe WHERE grpuid = '%s' ORDER BY grpuid ASC)ORDER BY
Line_Number_View ASC",query_result[x])

My question is
Is it possible to combine both these querries into one ? or in other words 
How to Select using Result obtained from other Select statements ?
Thanks in Advance,
Atul
-- 
View this message in context: 
http://www.nabble.com/how-to-Select-using-results-from-other-selects-in-a-single-SQlite-querry-statement---tp25149885p25149885.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


Re: [sqlite] Forensics data control

2009-08-26 Thread SQL Maestro Group
>> Well, now we want to add some sophisticated forensics features.
>> Currently we
>> have fancy filtering but no real OLAP sort of capability.
>>
> Are you talking straight OLAP, or do you have other forensic needs
> which will require you to roll your own functions ?  The only mention
> of OLAP on
>
> http://www.sqlite.org/cvstrac/wiki?p=ManagementTools
>
> is SQLite Maestro, a big many-functioned package compatible with many
> SQL engines.

Yes, SQLite Maestro includes an OLAP Builder. Examples can be found at
http://www.sqlmaestro.com/products/sqlite/maestro/screenshots/getting_started/data_analysis/
 

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