[sqlite] sqlite

2006-07-19 Thread sandhya
Hi,

Is there any possibility to import files from the local file system to the
sqlite DB.And Is there any export option is there just to check whether the
loaded file and exported file consists of same data or not.
Is it possible in sqlite?
If possible,How it will stores files in tables?In which format?
Please explain me how can i do it.

Thank you
Sandhya





[sqlite] finding the groups which have some sort of mising transaction

2006-07-19 Thread yuyen
HI, all

The following 2 queries (have the same result) are about to find some groups 
which have some sort of missing transactions. Please advise which one would 
have better performance. Thank you in advance!


SELECT docketno
FROM  cntt_sales2
GROUP BY docketno
HAVING MAX(CASE WHEN datacmd = 'RCP' THEN 1 ELSE 0 END) = 0
ORDER BY docketno


SELECT docketno FROM
(SELECT docketno, MAX(case when datacmd = 'RCP' then 1 else 0 end)AS opendoc 
FROM cntt_sales2 GROUP BY docketno)
WHERE opendoc = 0


Jack



Re: [sqlite] Resources required and Lock & recovery mechanisms

2006-07-19 Thread John Stanton
Sqlite requires few resources.  Locking is achieved through regular file 
locks which lock the entire database since it is a file.


Flow control is not applicable.

You may use semaphores etc in your application for synchronization, but 
they are not used by Sqlite.


Maintenance of an Sqlite database uses regular SQL.  Backups and loading 
are just file copies since an Sqlite database is a single file.


Vivek R wrote:

Hi Everybody,
I have the following doubt...

1. what are the resources required by SQLLite - they can be RAM/ROM,
semaphores, mail boxes, task requirements;
2. How do we have flow control?
3. what are the Lock mechanisms provided by the engine (row lock, table
lock..)? Any additional lock mechanism we need to build.

3. How to create a service component that creates these tables on HDD ( 
Hard

disk on Consumer products like DVD or Set top box ) before it leave the
factory.
4. recovery mechanisms (in case DB crash how do we recover/reconstruct
data?)


Thanks and Regards,
 Vivek R





[sqlite] Resources required and Lock & recovery mechanisms

2006-07-19 Thread Vivek R

Hi Everybody,
I have the following doubt...

1. what are the resources required by SQLLite - they can be RAM/ROM,
semaphores, mail boxes, task requirements;
2. How do we have flow control?
3. what are the Lock mechanisms provided by the engine (row lock, table
lock..)? Any additional lock mechanism we need to build.

3. How to create a service component that creates these tables on HDD ( Hard
disk on Consumer products like DVD or Set top box ) before it leave the
factory.
4. recovery mechanisms (in case DB crash how do we recover/reconstruct
data?)


Thanks and Regards,
 Vivek R


[sqlite] Order of columns within a CREATE TABLE statement

2006-07-19 Thread w b

Hi all,

Just had a quick question with regards to the order of the columns 
within a create table statement

I have a few tables that use the BLOB type for storing various lengths 
of binary data and I was wondering if its better (more efficient) to 
always declare columns of this type last within the create table 
statement or not. 

I'm not searching on these columns but they do have the chance of being 
updated with more or less binary data than was originally in them, so 
wondered if there is any penalty difference for having them at the end or 
in the middle of of a list of other columns within the table. Or does 
it not really matter given that any column can handle any data type ?


Thanks

Wayne


Re: [sqlite] Compress function

2006-07-19 Thread Cesar David Rodas Maldonado

D. Richard Hipp...

You are amazing!!! Thanks a lot for Sqlite and for help me!

God save D. Richard Hipp!

On Wed, 19 2006 17:44:46 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


"Cesar David Rodas Maldonado" <[EMAIL PROTECTED]> wrote:
> I need a funcion from compress a row with Zlib and  I am wondering if
SQLite
> support or if someone did it  and want to share him or her code.
>

Here some code that might help:

/*
** SQL function to compress content into a blob using libz
*/
static void compressFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int nIn, nOut;
  long int nOut2;
  const unsigned char *inBuf;
  unsigned char *outBuf;
  assert( argc==1 );
  nIn = sqlite3_value_bytes(argv[0]);
  inBuf = sqlite3_value_blob(argv[0]);
  nOut = 13 + nIn + (nIn+999)/1000;
  outBuf = malloc( nOut+4 );
  outBuf[0] = nIn>>24 & 0xff;
  outBuf[1] = nIn>>16 & 0xff;
  outBuf[2] = nIn>>8 & 0xff;
  outBuf[3] = nIn & 0xff;
  nOut2 = (long int)nOut;
  compress(&outBuf[4], &nOut2, inBuf, nIn);
  sqlite3_result_blob(context, outBuf, nOut2+4, free);
}

/*
** An SQL function to decompress.
*/
static void uncompressFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  unsigned int nIn, nOut, rc;
  const unsigned char *inBuf;
  unsigned char *outBuf;
  long int nOut2;

  assert( argc==1 );
  nIn = sqlite3_value_bytes(argv[0]);
  if( nIn<=4 ){
return;
  }
  inBuf = sqlite3_value_blob(argv[0]);
  nOut = (inBuf[0]<<24) + (inBuf[1]<<16) + (inBuf[2]<<8) + inBuf[3];
  outBuf = malloc( nOut );
  nOut2 = (long int)nOut;
  rc = uncompress(outBuf, &nOut2, &inBuf[4], nIn);
  if( rc!=Z_OK ){
free(outBuf);
  }else{
sqlite3_result_blob(context, outBuf, nOut2, free);
  }
}

/* Make the functions above accessible to SQLite as follows:
*/
  sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
 compressFunc, 0, 0);
  sqlite3_create_function(db, "uncompress", 1, SQLITE_UTF8, 0,
 uncompressFunc, 0, 0);

--
D. Richard Hipp   <[EMAIL PROTECTED]>




Re: [sqlite] Compress function

2006-07-19 Thread drh
"Cesar David Rodas Maldonado" <[EMAIL PROTECTED]> wrote:
> I need a funcion from compress a row with Zlib and  I am wondering if SQLite
> support or if someone did it  and want to share him or her code.
> 

Here some code that might help:

/*
** SQL function to compress content into a blob using libz
*/
static void compressFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int nIn, nOut;
  long int nOut2;
  const unsigned char *inBuf;
  unsigned char *outBuf;
  assert( argc==1 );
  nIn = sqlite3_value_bytes(argv[0]);
  inBuf = sqlite3_value_blob(argv[0]);
  nOut = 13 + nIn + (nIn+999)/1000;
  outBuf = malloc( nOut+4 );
  outBuf[0] = nIn>>24 & 0xff;
  outBuf[1] = nIn>>16 & 0xff;
  outBuf[2] = nIn>>8 & 0xff;
  outBuf[3] = nIn & 0xff;
  nOut2 = (long int)nOut;
  compress(&outBuf[4], &nOut2, inBuf, nIn);
  sqlite3_result_blob(context, outBuf, nOut2+4, free);  
}

/*
** An SQL function to decompress.
*/
static void uncompressFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  unsigned int nIn, nOut, rc;
  const unsigned char *inBuf;
  unsigned char *outBuf;
  long int nOut2;

  assert( argc==1 );
  nIn = sqlite3_value_bytes(argv[0]);
  if( nIn<=4 ){
return;
  }
  inBuf = sqlite3_value_blob(argv[0]);
  nOut = (inBuf[0]<<24) + (inBuf[1]<<16) + (inBuf[2]<<8) + inBuf[3];
  outBuf = malloc( nOut );
  nOut2 = (long int)nOut;
  rc = uncompress(outBuf, &nOut2, &inBuf[4], nIn);
  if( rc!=Z_OK ){
free(outBuf);
  }else{
sqlite3_result_blob(context, outBuf, nOut2, free);
  }
}

/* Make the functions above accessible to SQLite as follows:
*/
  sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0,
 compressFunc, 0, 0);
  sqlite3_create_function(db, "uncompress", 1, SQLITE_UTF8, 0,
 uncompressFunc, 0, 0);

--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] sqlite_master

2006-07-19 Thread Sripathi Raj

Hi,

What's the schema of sqlite_master? I'm trying to find trigger entries.

Thanks,

Raj


Re: [sqlite] count(*)

2006-07-19 Thread Sripathi Raj

There are no deletes on this table though.

On 7/19/06, Sripathi Raj <[EMAIL PROTECTED]> wrote:



What does LIMIT 1 do?


On 7/19/06, Brannon King <[EMAIL PROTECTED]> wrote:
>
> >> select rowid from table limit 1 offset -1;
> > Two ways to do this:
> >
> >SELECT rowid FROM table ORDER BY rowid DESC LIMIT 1;
> >SELECT max(rowid) FROM table;
>
> Yes, but neither one of those would be as fast as this query, true?
>
> SELECT rowid FROM table LIMIT 1
>
> I guess I was thinking to avoid the sort overhead.
>
>



Re: [sqlite] count(*)

2006-07-19 Thread Sripathi Raj

What does LIMIT 1 do?

On 7/19/06, Brannon King <[EMAIL PROTECTED]> wrote:


>> select rowid from table limit 1 offset -1;
> Two ways to do this:
>
>SELECT rowid FROM table ORDER BY rowid DESC LIMIT 1;
>SELECT max(rowid) FROM table;

Yes, but neither one of those would be as fast as this query, true?

SELECT rowid FROM table LIMIT 1

I guess I was thinking to avoid the sort overhead.




Re: [sqlite] Compress function

2006-07-19 Thread John Stanton

Cesar David Rodas Maldonado wrote:

I compile SQLITE 3 source into my APP, but i will like to use like mysql
uses ( the COMPRESS() function into the sql), understand?


I understand.  Unfortunately I haven't implemented that.


Re: [sqlite] Compress function

2006-07-19 Thread Cesar David Rodas Maldonado

I compile SQLITE 3 source into my APP, but i will like to use like mysql
uses ( the COMPRESS() function into the sql), understand?


Re: [sqlite] reg:sqlite usage

2006-07-19 Thread A. Pagaltzis
* sandhya <[EMAIL PROTECTED]> [2006-07-19 14:10]:
> Also you wanna want to say that we shouldn't use this in Client
> /Server applications.Like,Connecting to the Sqlite server
> through the application and performing all the operations
> through(application) it and updating the server.

Not “should” – you *cannot*, because there is no server. SQLite
is just a simple library. It does not connect to a server that
performs the database operations, but instead it manipulates the
file containing the database directly.

That part of the reason why it needs so few resources. It is also
why it is easy to use on embedded devices, and why it does not
require any configuration, user management or any of the other
complex administration that client-server databases require.

Regards,
-- 
Aristotle Pagaltzis // 


Re: [sqlite] Compress function

2006-07-19 Thread John Stanton

Cesar David Rodas Maldonado wrote:
I need a funcion from compress a row with Zlib and  I am wondering if 
SQLite

support or if someone did it  and want to share him or her code.

Thanks to all

Do you want to have it as an Sqlite function or as a function in your 
application?


In general you just download zlib and compile the library on your 
machine and use the examples in the zlib release as a template.


Re: [sqlite] reg:sqlite usage

2006-07-19 Thread John Stanton
The way we use Sqlite in web applications is as part of the web server, 
creating an application server.  We wrote our own webserver and 
application specific language processor and use Sqlite for storage. 
Sqlite is a great component for such a project and means that one 
multi-threaded process runs everything instead of having web servers, 
cgi processes and DBMS servers linked by interprocess communication.


We also created CGI processes which perform web activities and which 
have embedded Sqlite and XML.


Another way for you to use Sqlite is to use it embedded in something 
like PHP (which comes supplied with embedded Sqlite) or to use a wrapper 
around Sqlite for your favorite high level language.  We don't use it 
that way so others can give you better advice if you go that way.


sandhya wrote:

John,
 If  u don't mind can you please explain me is it possible if i load /store
any files as Large objects inside DB and open it via a webserver instead of
storing it in a local system and opening.In that case what i have to do.Like
my DB whether i should place in the Webserver applcaition and access it or
how can i do it?




- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 19, 2006 6:04 PM
Subject: Re: [sqlite] reg:sqlite usage




Sqlite is a wonderful tool.  We use it with great success embedded in a
custom application server for web applications, embedded in CGI
processes and in some industrial process control applications.  It is
robust and very simple to use, and since it places all tables in one
file, very easy to maintain.

sandhya wrote:


ya..Thank you ver much John.Right now i am using Postgresql only.But


just i


want to find out the information abt Sqlite as i heard that it is having
very small footprint and its good for Embedded systems app.
Now i got it,Thanks a lot.

-Sandhya

- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 19, 2006 5:53 PM
Subject: Re: [sqlite] reg:sqlite usage





Sandhya,

You use Sqlite the same way you use a file in your application.  You
link in the runtime library containing the file handling API when you
create your executable.  Sqlite gives an embedded application the
capability of using SQL for data management.

If you are building a client server model you might want to look at
using something like PostgreSQL or Mysql which are DBMS servers.  There
is no Sqlite server.

Sqlite is used as an embedded DBMS in programs such as the Firefox
browser, LCC IDE and similar.

sandhya wrote:



You link Sqlite into your application...May i know what it mean?
Please explain me.
Also you wanna want to say that we shouldn't use this in Client /Server
applications.Like,Connecting to the Sqlite server through the


application



and performing all the operations through(application) it and updating


the



server.
Really i am totally confused with this...If you don't mind can you


just



explain me where we can use this SQLITE.pls

Thank you,
Sandhya



- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 19, 2006 5:10 PM
Subject: Re: [sqlite] reg:sqlite usage






Sandhya,

You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY,


not


a server.  You link Sqlite into your application.  As Dr Hipp points


out


it it an alternative to fopen, not Oracle.

sandhya wrote:




Hi,
I am very new to SQLITE.I have downloaded and installed Sqlite 3 in


my



windows system.I built lib and dll too.
I tried the sample given in the documetation.The connection info i


have


given the DB name, the table name and the query.But the database name


what




ever i am giving it is getting stored in my current application.Will


it


be




like that.
Is there any interface to see the tables i have created in using the


sample




given there?
Where can i manually enter the queries?
Can i perform Client-server application kind of a thing.
I mean,With the available API , i will be writing the coding and


which


will




perform all the operations mentined like creating table,DB,inserting


etc



etc.Which should update in server directly.If i want to do


so.Where


i




need to mention the IP of my server.
Please guide me how to proceed for Client/Server kind of


applications.


Thank you.
Regards
Sandhya R
















Re: [sqlite] Compress function

2006-07-19 Thread Jay Sprenkle

On 7/19/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:

Do you know for how much money?

On 7/19/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote:
>
> The author of Sqlite also sells a version that compresses and encrypts
> the database.


from this page: http://www.hwaci.com/sw/sqlite/prosupport.html



3.0 Encrypted Databases

An enhanced version of SQLite is available (for both versions 2.8 and
3.3) that encrypts its database files to help prevent unauthorized
access or modification. The entire database file is encrypted2. To an
outside observer, the database file appears to contain white noise.
There is nothing2 that identifies the file as an SQLite database.

The enhanced SQLite with encryption support can continue to read and
write ordinary unencrypted databases without any performance penalty.
You can use the ATTACH SQL command to attach an encrypted database to
an unencrypted database or to attach an unencrypted database to an
encrypted one. The password to a database can be changed at any time,
though doing so is an expensive operation roughly comparable to
VACUUM.

The encryption extension descrypts each page of data as it is read
from the disk and reencrypts it as modified versions are written back
to the disk. But the primary database file and the rollback journal
are encrypted. A very fast encryption algorithm is used, but even so
it takes time to do all of that encryption and decryption. So when
encryption is enabled, there is about a 50% performance loss.

The encrypted database enhancements for SQLite are available in
source-code form for a one-time licensing fee of $2000 (US). A
technical support contract is also recommended but is not required.
There are no per-copy royalties. The one-time fee entitles the
licensee to free copies of all future updates to the code. You can
purchase a perpetual license to the SQLite Encryption Extension online
or call +1.704.948.4565 or write to [EMAIL PROTECTED] for
additional information.

4.0 Compressed and Encrypted Read-Only Databases

A separate extension is available that allows SQLite to read database
files that have been both compressed and encrypted. The amount of
compression depends on the kind of data that is stored, of course, but
typically is in the 50% to 70% range.

Compressed databases are read-only. To create a compressed database,
first construct a normal uncompressed database holding the desired
data. Then run a special command-line tool (included with the
extension) that converts the uncompressed database into a much smaller
compressed and encrypted database. Afterwards the compressed database
can be read (but not written) using this extension.

Compressed databases are useful in products that contain a large fixed
data set that needs to be squeezed into the limited memory space of a
PDA or other gadget or onto a single CD-ROM or DVD. If an application
has both a large fixed data set but also some smaller read/write
tables, then the large fixed data set can be stored in a compressed
database file and the variable database can be held in a separate
uncompressed read/write database. The two databases can be accessed as
if they were one using the ATTACH command in SQLite.

The compressed database extension is separate from the encrypted
database extension described in section 3.0 above. But the two
extensions can be used together if desired. The compressed database
extension is currently in development. A finished version is expected
to be available with the release of SQLite version 3.3.0 in January of
2006. However, beta copies are available immediately for preliminary
testing purposes.

The compressed database extension for SQLite are available in
source-code form for a one-time licensing fee of $2000 (US). A
technical support contract is also recommended but is not required.
There are no per-copy royalties. The one-time fee entitles the
licensee to free copies of all future updates to the code. Call
704.948.4565 or write to [EMAIL PROTECTED] for additional
information.

5.0 Custom Modifications

Some projects can be best served by a customized version of SQLite
with specialized capabilities and/or extensions. For example:

   * Specialize performance tuning or optimization for a particular
class of query
   * Ports of SQLite to new operating systems or execution environments
   * Application-specific extensions to the SQL query language
   * Enhanced security features
   * Bindings to alternative programming languages

You should not have to settle for a proprietary database library that
lacks needed features when you can have full source code and unlimited
rights to a database that meets your needs exactly and completely.
Just let us know what your special requirements are. We can reply with
either a fixed-priced bid or give you an estimate and an hourly
billing rate.


Re: [sqlite] Compress function

2006-07-19 Thread Cesar David Rodas Maldonado

Do you know for how much money?

On 7/19/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote:


The author of Sqlite also sells a version that compresses and encrypts
the database.

On 7/19/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:
> Thanks Hugh, i think it will be useful for me...
>
> On Wed, 19 Jul 2006 16:07 +0100 (BST), Hugh Gibson <[EMAIL PROTECTED]>
> wrote:
> >
> > You could try http://web.utk.edu/~jplyon/sqlite/code/sqaux-userfns.cbut
> > it's a little old now.



RE: [sqlite] count(*)

2006-07-19 Thread Brannon King
>> select rowid from table limit 1 offset -1;
> Two ways to do this:
> 
>SELECT rowid FROM table ORDER BY rowid DESC LIMIT 1;
>SELECT max(rowid) FROM table;

Yes, but neither one of those would be as fast as this query, true?

SELECT rowid FROM table LIMIT 1

I guess I was thinking to avoid the sort overhead.



Re: [sqlite] Compress function

2006-07-19 Thread Jay Sprenkle

The author of Sqlite also sells a version that compresses and encrypts
the database.

On 7/19/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote:

Thanks Hugh, i think it will be useful for me...

On Wed, 19 Jul 2006 16:07 +0100 (BST), Hugh Gibson <[EMAIL PROTECTED]>
wrote:
>
> You could try http://web.utk.edu/~jplyon/sqlite/code/sqaux-userfns.c but
> it's a little old now.


Re: [sqlite] Compress function

2006-07-19 Thread Cesar David Rodas Maldonado

Thanks Hugh, i think it will be useful for me...

On Wed, 19 Jul 2006 16:07 +0100 (BST), Hugh Gibson <[EMAIL PROTECTED]>
wrote:


You could try http://web.utk.edu/~jplyon/sqlite/code/sqaux-userfns.c but
it's a little old now.

Hugh



RE: [sqlite] Re: I need help making this code run faster

2006-07-19 Thread Eduardo

At 23:29 18/07/2006, you wrote:

Thanks, Igor, you've inspired and saved me yet again. The subqueries you had
used for the x/yEnd did not work, but the rest did and I have that maxim
information beforehand anyway. Here's how it shook down:

select
  cast(cast((xStart+xEnd) as double)/2/15518.5 as integer) cellX,
  cast(cast((yStart+yEnd) as double)/2/15603.171875 as integer) cellY,
  max(score)
from results_1
group by cellX, cellY;


change divisions /2  /15518.5 by  *0.5  *0.64439 or better 
*0.32219.  Similar for cellY.


-
La diferencia entre la teoria y la practica es que en teoria no hay, 
pero en la practica si 



Re: [sqlite] Compress function

2006-07-19 Thread Hugh Gibson
You could try http://web.utk.edu/~jplyon/sqlite/code/sqaux-userfns.c but it's a 
little old now.

Hugh


[sqlite] Compress function

2006-07-19 Thread Cesar David Rodas Maldonado

I need a funcion from compress a row with Zlib and  I am wondering if SQLite
support or if someone did it  and want to share him or her code.

Thanks to all


Re: [sqlite] count(*)

2006-07-19 Thread Jay Sprenkle

On Wed, 19  2006 06:08:49 -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Brannon King <[EMAIL PROTECTED]> wrote:
> It's too bad you can't do an offset
> of negative one so that it would start at the back. That should be darn
> fast. Something like:
>
> select rowid from table limit 1 offset -1;
>

Two ways to do this:

   SELECT rowid FROM table ORDER BY rowid DESC LIMIT 1;
   SELECT max(rowid) FROM table;


If the rowid column is a unique indexed column will select count(*)
only access the index to calculate the count? Would you need to
use  SELECT count( indexed_column ) instead of SELECT count(*)?

--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com


Re: [sqlite] reg:sqlite usage

2006-07-19 Thread sandhya
John,
 If  u don't mind can you please explain me is it possible if i load /store
any files as Large objects inside DB and open it via a webserver instead of
storing it in a local system and opening.In that case what i have to do.Like
my DB whether i should place in the Webserver applcaition and access it or
how can i do it?




- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, July 19, 2006 6:04 PM
Subject: Re: [sqlite] reg:sqlite usage


> Sqlite is a wonderful tool.  We use it with great success embedded in a
> custom application server for web applications, embedded in CGI
> processes and in some industrial process control applications.  It is
> robust and very simple to use, and since it places all tables in one
> file, very easy to maintain.
>
> sandhya wrote:
> > ya..Thank you ver much John.Right now i am using Postgresql only.But
just i
> > want to find out the information abt Sqlite as i heard that it is having
> > very small footprint and its good for Embedded systems app.
> > Now i got it,Thanks a lot.
> >
> > -Sandhya
> >
> > - Original Message - 
> > From: "John Stanton" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Wednesday, July 19, 2006 5:53 PM
> > Subject: Re: [sqlite] reg:sqlite usage
> >
> >
> >
> >>Sandhya,
> >>
> >>You use Sqlite the same way you use a file in your application.  You
> >>link in the runtime library containing the file handling API when you
> >>create your executable.  Sqlite gives an embedded application the
> >>capability of using SQL for data management.
> >>
> >>If you are building a client server model you might want to look at
> >>using something like PostgreSQL or Mysql which are DBMS servers.  There
> >>is no Sqlite server.
> >>
> >>Sqlite is used as an embedded DBMS in programs such as the Firefox
> >>browser, LCC IDE and similar.
> >>
> >>sandhya wrote:
> >>
> >>>You link Sqlite into your application...May i know what it mean?
> >>>Please explain me.
> >>>Also you wanna want to say that we shouldn't use this in Client /Server
> >>>applications.Like,Connecting to the Sqlite server through the
> >
> > application
> >
> >>>and performing all the operations through(application) it and updating
> >
> > the
> >
> >>>server.
> >>>Really i am totally confused with this...If you don't mind can you
> >
> > just
> >
> >>>explain me where we can use this SQLITE.pls
> >>>
> >>>Thank you,
> >>>Sandhya
> >>>
> >>>
> >>>
> >>>- Original Message - 
> >>>From: "John Stanton" <[EMAIL PROTECTED]>
> >>>To: 
> >>>Sent: Wednesday, July 19, 2006 5:10 PM
> >>>Subject: Re: [sqlite] reg:sqlite usage
> >>>
> >>>
> >>>
> >>>
> Sandhya,
> 
> You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY,
not
> a server.  You link Sqlite into your application.  As Dr Hipp points
out
> it it an alternative to fopen, not Oracle.
> 
> sandhya wrote:
> 
> 
> >Hi,
> > I am very new to SQLITE.I have downloaded and installed Sqlite 3 in
> >
> > my
> >
> >windows system.I built lib and dll too.
> >I tried the sample given in the documetation.The connection info i
have
> >given the DB name, the table name and the query.But the database name
> >>>
> >>>what
> >>>
> >>>
> >ever i am giving it is getting stored in my current application.Will
it
> >>>
> >>>be
> >>>
> >>>
> >like that.
> >Is there any interface to see the tables i have created in using the
> >>>
> >>>sample
> >>>
> >>>
> >given there?
> >Where can i manually enter the queries?
> >Can i perform Client-server application kind of a thing.
> >I mean,With the available API , i will be writing the coding and
which
> >>>
> >>>will
> >>>
> >>>
> >perform all the operations mentined like creating table,DB,inserting
> >
> > etc
> >
> >etc.Which should update in server directly.If i want to do
so.Where
> >>>
> >>>i
> >>>
> >>>
> >need to mention the IP of my server.
> >Please guide me how to proceed for Client/Server kind of
applications.
> >
> >Thank you.
> >Regards
> >Sandhya R
> >
> >
> >
> 
> >>>
> >>>
> >
> >
>




Re: [sqlite] reg:sqlite usage

2006-07-19 Thread John Stanton
Sqlite is a wonderful tool.  We use it with great success embedded in a 
custom application server for web applications, embedded in CGI 
processes and in some industrial process control applications.  It is 
robust and very simple to use, and since it places all tables in one 
file, very easy to maintain.


sandhya wrote:

ya..Thank you ver much John.Right now i am using Postgresql only.But just i
want to find out the information abt Sqlite as i heard that it is having
very small footprint and its good for Embedded systems app.
Now i got it,Thanks a lot.

-Sandhya

- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 19, 2006 5:53 PM
Subject: Re: [sqlite] reg:sqlite usage




Sandhya,

You use Sqlite the same way you use a file in your application.  You
link in the runtime library containing the file handling API when you
create your executable.  Sqlite gives an embedded application the
capability of using SQL for data management.

If you are building a client server model you might want to look at
using something like PostgreSQL or Mysql which are DBMS servers.  There
is no Sqlite server.

Sqlite is used as an embedded DBMS in programs such as the Firefox
browser, LCC IDE and similar.

sandhya wrote:


You link Sqlite into your application...May i know what it mean?
Please explain me.
Also you wanna want to say that we shouldn't use this in Client /Server
applications.Like,Connecting to the Sqlite server through the


application


and performing all the operations through(application) it and updating


the


server.
Really i am totally confused with this...If you don't mind can you


just


explain me where we can use this SQLITE.pls

Thank you,
Sandhya



- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 19, 2006 5:10 PM
Subject: Re: [sqlite] reg:sqlite usage





Sandhya,

You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY, not
a server.  You link Sqlite into your application.  As Dr Hipp points out
it it an alternative to fopen, not Oracle.

sandhya wrote:



Hi,
I am very new to SQLITE.I have downloaded and installed Sqlite 3 in


my


windows system.I built lib and dll too.
I tried the sample given in the documetation.The connection info i have
given the DB name, the table name and the query.But the database name


what



ever i am giving it is getting stored in my current application.Will it


be



like that.
Is there any interface to see the tables i have created in using the


sample



given there?
Where can i manually enter the queries?
Can i perform Client-server application kind of a thing.
I mean,With the available API , i will be writing the coding and which


will



perform all the operations mentined like creating table,DB,inserting


etc


etc.Which should update in server directly.If i want to do so.Where


i



need to mention the IP of my server.
Please guide me how to proceed for Client/Server kind of applications.

Thank you.
Regards
Sandhya R















Re: [sqlite] reg:sqlite usage

2006-07-19 Thread sandhya
ya..Thank you ver much John.Right now i am using Postgresql only.But just i
want to find out the information abt Sqlite as i heard that it is having
very small footprint and its good for Embedded systems app.
Now i got it,Thanks a lot.

-Sandhya

- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, July 19, 2006 5:53 PM
Subject: Re: [sqlite] reg:sqlite usage


> Sandhya,
>
> You use Sqlite the same way you use a file in your application.  You
> link in the runtime library containing the file handling API when you
> create your executable.  Sqlite gives an embedded application the
> capability of using SQL for data management.
>
> If you are building a client server model you might want to look at
> using something like PostgreSQL or Mysql which are DBMS servers.  There
> is no Sqlite server.
>
> Sqlite is used as an embedded DBMS in programs such as the Firefox
> browser, LCC IDE and similar.
>
> sandhya wrote:
> > You link Sqlite into your application...May i know what it mean?
> > Please explain me.
> > Also you wanna want to say that we shouldn't use this in Client /Server
> > applications.Like,Connecting to the Sqlite server through the
application
> > and performing all the operations through(application) it and updating
the
> > server.
> > Really i am totally confused with this...If you don't mind can you
just
> > explain me where we can use this SQLITE.pls
> >
> > Thank you,
> > Sandhya
> >
> >
> >
> > - Original Message - 
> > From: "John Stanton" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Wednesday, July 19, 2006 5:10 PM
> > Subject: Re: [sqlite] reg:sqlite usage
> >
> >
> >
> >>Sandhya,
> >>
> >>You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY, not
> >>a server.  You link Sqlite into your application.  As Dr Hipp points out
> >>it it an alternative to fopen, not Oracle.
> >>
> >>sandhya wrote:
> >>
> >>>Hi,
> >>>  I am very new to SQLITE.I have downloaded and installed Sqlite 3 in
my
> >>>windows system.I built lib and dll too.
> >>>I tried the sample given in the documetation.The connection info i have
> >>>given the DB name, the table name and the query.But the database name
> >
> > what
> >
> >>>ever i am giving it is getting stored in my current application.Will it
> >
> > be
> >
> >>>like that.
> >>>Is there any interface to see the tables i have created in using the
> >
> > sample
> >
> >>>given there?
> >>>Where can i manually enter the queries?
> >>>Can i perform Client-server application kind of a thing.
> >>>I mean,With the available API , i will be writing the coding and which
> >
> > will
> >
> >>>perform all the operations mentined like creating table,DB,inserting
etc
> >>>etc.Which should update in server directly.If i want to do so.Where
> >
> > i
> >
> >>>need to mention the IP of my server.
> >>>Please guide me how to proceed for Client/Server kind of applications.
> >>>
> >>>Thank you.
> >>>Regards
> >>>Sandhya R
> >>>
> >>>
> >>>
> >>
> >
> >
> >
>




Re: [sqlite] reg:sqlite usage

2006-07-19 Thread John Stanton

Sandhya,

You use Sqlite the same way you use a file in your application.  You 
link in the runtime library containing the file handling API when you 
create your executable.  Sqlite gives an embedded application the 
capability of using SQL for data management.


If you are building a client server model you might want to look at 
using something like PostgreSQL or Mysql which are DBMS servers.  There 
is no Sqlite server.


Sqlite is used as an embedded DBMS in programs such as the Firefox 
browser, LCC IDE and similar.


sandhya wrote:

You link Sqlite into your application...May i know what it mean?
Please explain me.
Also you wanna want to say that we shouldn't use this in Client /Server
applications.Like,Connecting to the Sqlite server through the application
and performing all the operations through(application) it and updating the
server.
Really i am totally confused with this...If you don't mind can you just
explain me where we can use this SQLITE.pls

Thank you,
Sandhya



- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, July 19, 2006 5:10 PM
Subject: Re: [sqlite] reg:sqlite usage




Sandhya,

You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY, not
a server.  You link Sqlite into your application.  As Dr Hipp points out
it it an alternative to fopen, not Oracle.

sandhya wrote:


Hi,
 I am very new to SQLITE.I have downloaded and installed Sqlite 3 in my
windows system.I built lib and dll too.
I tried the sample given in the documetation.The connection info i have
given the DB name, the table name and the query.But the database name


what


ever i am giving it is getting stored in my current application.Will it


be


like that.
Is there any interface to see the tables i have created in using the


sample


given there?
Where can i manually enter the queries?
Can i perform Client-server application kind of a thing.
I mean,With the available API , i will be writing the coding and which


will


perform all the operations mentined like creating table,DB,inserting etc
etc.Which should update in server directly.If i want to do so.Where


i


need to mention the IP of my server.
Please guide me how to proceed for Client/Server kind of applications.

Thank you.
Regards
Sandhya R













Re: [sqlite] reg:sqlite usage

2006-07-19 Thread sandhya
You link Sqlite into your application...May i know what it mean?
Please explain me.
Also you wanna want to say that we shouldn't use this in Client /Server
applications.Like,Connecting to the Sqlite server through the application
and performing all the operations through(application) it and updating the
server.
Really i am totally confused with this...If you don't mind can you just
explain me where we can use this SQLITE.pls

Thank you,
Sandhya



- Original Message - 
From: "John Stanton" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, July 19, 2006 5:10 PM
Subject: Re: [sqlite] reg:sqlite usage


> Sandhya,
>
> You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY, not
> a server.  You link Sqlite into your application.  As Dr Hipp points out
> it it an alternative to fopen, not Oracle.
>
> sandhya wrote:
> > Hi,
> >   I am very new to SQLITE.I have downloaded and installed Sqlite 3 in my
> > windows system.I built lib and dll too.
> > I tried the sample given in the documetation.The connection info i have
> > given the DB name, the table name and the query.But the database name
what
> > ever i am giving it is getting stored in my current application.Will it
be
> > like that.
> > Is there any interface to see the tables i have created in using the
sample
> > given there?
> > Where can i manually enter the queries?
> > Can i perform Client-server application kind of a thing.
> > I mean,With the available API , i will be writing the coding and which
will
> > perform all the operations mentined like creating table,DB,inserting etc
> > etc.Which should update in server directly.If i want to do so.Where
i
> > need to mention the IP of my server.
> > Please guide me how to proceed for Client/Server kind of applications.
> >
> > Thank you.
> > Regards
> > Sandhya R
> >
> >
> >
>





Re: [sqlite] reg:sqlite usage

2006-07-19 Thread John Stanton

Sandhya,

You have not grasped the concept of Sqlite.  It is a RDBMS LIBRARY, not 
a server.  You link Sqlite into your application.  As Dr Hipp points out 
it it an alternative to fopen, not Oracle.


sandhya wrote:

Hi,
  I am very new to SQLITE.I have downloaded and installed Sqlite 3 in my
windows system.I built lib and dll too.
I tried the sample given in the documetation.The connection info i have
given the DB name, the table name and the query.But the database name what
ever i am giving it is getting stored in my current application.Will it be
like that.
Is there any interface to see the tables i have created in using the sample
given there?
Where can i manually enter the queries?
Can i perform Client-server application kind of a thing.
I mean,With the available API , i will be writing the coding and which will
perform all the operations mentined like creating table,DB,inserting etc
etc.Which should update in server directly.If i want to do so.Where i
need to mention the IP of my server.
Please guide me how to proceed for Client/Server kind of applications.

Thank you.
Regards
Sandhya R







Re: [sqlite] count(*) - maybe a 3rd

2006-07-19 Thread carl clemens
Hi,

If a table has a primary key selecting count(*)
using it maybe faster if there is a difference
of the number of rows stored per page.  A wide table
will do more io than the index.  The table names is
not very wide but does consume more disk space than 
than the primary keys index.  


 
sql3> select count(*) from names;
count(*)  
--
88799 

1 row(s) selected

Elapsed time:  0.100965
sql3> select count(*) from names where name > ' ';
count(*)  
--
88799 

1 row(s) selected

Elapsed time:  0.096625
sql3> 


--- [EMAIL PROTECTED] wrote:

> Brannon King <[EMAIL PROTECTED]> wrote:
> > It's too bad you can't do an offset 
> > of negative one so that it would start at the
> back. That should be darn 
> > fast. Something like:
> > 
> > select rowid from table limit 1 offset -1;
> > 
> 
> Two ways to do this:
> 
>SELECT rowid FROM table ORDER BY rowid DESC LIMIT
> 1;
>SELECT max(rowid) FROM table;
> 
> --
> D. Richard Hipp   <[EMAIL PROTECTED]>
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: [sqlite] count(*)

2006-07-19 Thread drh
Brannon King <[EMAIL PROTECTED]> wrote:
> It's too bad you can't do an offset 
> of negative one so that it would start at the back. That should be darn 
> fast. Something like:
> 
> select rowid from table limit 1 offset -1;
> 

Two ways to do this:

   SELECT rowid FROM table ORDER BY rowid DESC LIMIT 1;
   SELECT max(rowid) FROM table;

--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] reg:sqlite usage

2006-07-19 Thread sandhya
Hi,
  I am very new to SQLITE.I have downloaded and installed Sqlite 3 in my
windows system.I built lib and dll too.
I tried the sample given in the documetation.The connection info i have
given the DB name, the table name and the query.But the database name what
ever i am giving it is getting stored in my current application.Will it be
like that.
Is there any interface to see the tables i have created in using the sample
given there?
Where can i manually enter the queries?
Can i perform Client-server application kind of a thing.
I mean,With the available API , i will be writing the coding and which will
perform all the operations mentined like creating table,DB,inserting etc
etc.Which should update in server directly.If i want to do so.Where i
need to mention the IP of my server.
Please guide me how to proceed for Client/Server kind of applications.

Thank you.
Regards
Sandhya R