Re: [sqlite] Using the Sqlite Btree Backend directly

2007-03-30 Thread John Stanton
Why not implement a simple index file system like one of the DBase 
derivatives?  If you have no OS you will find porting something like 
Sqlite or Berkely DB a challenge.  If you are not looking for SQL then 
you can achieve your goal in maybe 20K of memory.


[EMAIL PROTECTED] wrote:
 P Kishor <[EMAIL PROTECTED]> wrote: 


On 3/29/07, Ludvig Strigeus <[EMAIL PROTECTED]> wrote:


Hi,

I'm looking at using Sqlite as a storage backend for a program. Using SQL is
a little bit overkill and much more than we need. How complicated would it
be to interface to the btree subsystem directly? Sqlite seems very modular
from the looks of it, but has anyone attempted anything like this before?

The functionality I need is key->value maps with support for lookup by an
exact key, insertion, iteration of all keys in the database, removal.
Transactions would also preferably be needed.




why bother with SQLite then? Use the right tool for the job -- use BerkeleyDB.


--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




Size is a constraint for me.
I see that SQLite can be around 170KB where BerkeleyDB is around 500K.
I also see that the SQL statements can be converted to byte code.
Is this byte code more efficient that the SQL statement in code size?
I'm looking at embedding a DB of some type into a Single Board Computer with no 
OS.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Using the Sqlite Btree Backend directly

2007-03-30 Thread rhurst2

 [EMAIL PROTECTED] wrote: 
> <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I'm looking at using Sqlite as a storage backend for a program.
> > > > Using SQL is a little bit overkill
> > > 
> > > why bother with SQLite then? Use the right tool for the job
> > > -- use BerkeleyDB.
> > > 
> > 
> > Size is a constraint for me.
> > I see that SQLite can be around 170KB where BerkeleyDB is around 500K.
> > I also see that the SQL statements can be converted to byte code.
> > Is this byte code more efficient that the SQL statement in code size?
> > I'm looking at embedding a DB of some type into a Single Board Computer
> > with no OS.
> > 
> 
> There is a proprietary version of SQLite (call the SQLite Stored
> Statement Extension of "SSE") that can be as small as about 50K,
> especially if all you want is key/value pairs.
> 
> SSE omits the SQL parser on the embedded device.  You store the
> SQL statements that you want to run in a table in your database
> file.  Then on a development machine, you run a special command
> that precompiles those SQL statements into bytecode and stores
> the bytecode back in the database in place of the original SQL.  
> Then you transfer the database to the embedded device.  On the 
> embedded device, you specify precompiled SQL statements by number,
> loading them out of the database as sqlite3_stmt objects.  Then
> you bind host parameters and run sqlite3_step() and sqlite3_reset()
> or sqlite3_finalize() just like you normally would.
> 
> SSE is currently used on smart cards where memory is scarce and
> battery power even scarcer.  But it is proprietary, not free like
> standard SQLite.  On the other hand, it is much, much less expensive
> than BDB.
> 
> The bytecode is actually larger than the original SQL statements,
> in most cases.  How much larger depends on the statement.  SQL like
> 
>  SELECT * FROM table1
> 
> can generate either small or large amounts of byte code depending,
> for example, on how many columns the "*" expands into.
> 
> Please contact me off-list if you want more information.
> 
> --
> D. Richard Hipp  <[EMAIL PROTECTED]>
> 
> 
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 
Yes. I'd like more info on SSE.
I'm need a database that stores name(text)/value(intgeres, blobs, text, etc).
I't must be as small in size as possible and still have ACID and transaction 
rollback capabilities. What is available?
Ray Hurst

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Using the Sqlite Btree Backend directly

2007-03-30 Thread drh
<[EMAIL PROTECTED]> wrote:
> > >
> > > I'm looking at using Sqlite as a storage backend for a program.
> > > Using SQL is a little bit overkill
> > 
> > why bother with SQLite then? Use the right tool for the job
> > -- use BerkeleyDB.
> > 
> 
> Size is a constraint for me.
> I see that SQLite can be around 170KB where BerkeleyDB is around 500K.
> I also see that the SQL statements can be converted to byte code.
> Is this byte code more efficient that the SQL statement in code size?
> I'm looking at embedding a DB of some type into a Single Board Computer
> with no OS.
> 

There is a proprietary version of SQLite (call the SQLite Stored
Statement Extension of "SSE") that can be as small as about 50K,
especially if all you want is key/value pairs.

SSE omits the SQL parser on the embedded device.  You store the
SQL statements that you want to run in a table in your database
file.  Then on a development machine, you run a special command
that precompiles those SQL statements into bytecode and stores
the bytecode back in the database in place of the original SQL.  
Then you transfer the database to the embedded device.  On the 
embedded device, you specify precompiled SQL statements by number,
loading them out of the database as sqlite3_stmt objects.  Then
you bind host parameters and run sqlite3_step() and sqlite3_reset()
or sqlite3_finalize() just like you normally would.

SSE is currently used on smart cards where memory is scarce and
battery power even scarcer.  But it is proprietary, not free like
standard SQLite.  On the other hand, it is much, much less expensive
than BDB.

The bytecode is actually larger than the original SQL statements,
in most cases.  How much larger depends on the statement.  SQL like

 SELECT * FROM table1

can generate either small or large amounts of byte code depending,
for example, on how many columns the "*" expands into.

Please contact me off-list if you want more information.

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



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] PLSQL

2007-03-30 Thread John Stanton

Thanks for the comments.
JS

Ken wrote:

John,
 
 I've used PL/SQL on Oracle.  I think it was derived from another language, maybe PL/1.
 
 I think its an excellent language, my main usage was geared at PL/SQL for DBA usage that managed internal oracle objects.
 
 Pros: Packages / Procedures/ Functions have a really nice hierarchy. 
   Exception handling was excellent.

   cursor handing internaly was good.
   Record handling was good.
   
 Cons: Permission sheme was a pain. Ofter requiring direct ownership of objects rather than through grants.

 Array handling was poor. Var arrays helped but seemed rather 
cumbersome to utilize.
 
 Triggers are implemented via PL/SQL.
 
 
 
 


John Stanton <[EMAIL PROTECTED]> wrote: I am looking for advice experienced 
DBMS users please.

I am currently implementing an application server using Sqlite as an 
embedded RDBMS and have a need for expanded function capability.  My 
server provides support for AJAX style WWW applications.


I have not used PLSQL to any significant degree and would be interested 
to hear pros and cons from users.  I am attracted to have a function 
language compatible with Oracle and PostgreSQL but wonder if PLSQL is 
actually a good language to create SQL functions which realise business 
rules and whether users find it easy to grasp so that they can maintain 
the PLSQL functions.  Does anyone have a better idea?


My plan is to compile the function language into a byte code and embed a 
virtual machine to execute it.  The application server already has a 
virtual machine which executes a simple language which integrates SQL, 
HTML and Javascript along with some rudimentary control structures to 
define workflow.  The function language would be used to define business 
rules and be part of a remote procedure call process used by the AJAX 
applications.


I should very much appreciate some wise counsel.

BTW, I shall make the server available if it turns out to work as planned.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Using the Sqlite Btree Backend directly

2007-03-30 Thread rhurst2

 P Kishor <[EMAIL PROTECTED]> wrote: 
> On 3/29/07, Ludvig Strigeus <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I'm looking at using Sqlite as a storage backend for a program. Using SQL is
> > a little bit overkill and much more than we need. How complicated would it
> > be to interface to the btree subsystem directly? Sqlite seems very modular
> > from the looks of it, but has anyone attempted anything like this before?
> >
> > The functionality I need is key->value maps with support for lookup by an
> > exact key, insertion, iteration of all keys in the database, removal.
> > Transactions would also preferably be needed.
> >
> 
> 
> why bother with SQLite then? Use the right tool for the job -- use BerkeleyDB.
> 
> 
> -- 
> Puneet Kishor http://punkish.eidesis.org/
> Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
> Open Source Geospatial Foundation http://www.osgeo.org/education/
> -
> collaborate, communicate, compete
> =
> 
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
> -
> 

Size is a constraint for me.
I see that SQLite can be around 170KB where BerkeleyDB is around 500K.
I also see that the SQL statements can be converted to byte code.
Is this byte code more efficient that the SQL statement in code size?
I'm looking at embedding a DB of some type into a Single Board Computer with no 
OS.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] in-memory database bound to a named buffer

2007-03-30 Thread Ken
short answer is no.
 
 The memory structures are not identical to disk structures.
 

Ryan Underwood <[EMAIL PROTECTED]> wrote: 
Is it possible to bind an in-memory sqlite database (in read-only mode,
naturally) to an existing named memory buffer that contains exactly the
contents of a sqlite database file?

What I want to do is maintain a database as usual, but then take an
occasional snapshot, bin2c it and include it in my
(platform/OS-independent) project.

I looked for functions that would take a mmap'd file (which would be
equivalent), but didn't see anything...

-- 
Ryan Underwood, 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




[sqlite] in-memory database bound to a named buffer

2007-03-30 Thread Ryan Underwood

Is it possible to bind an in-memory sqlite database (in read-only mode,
naturally) to an existing named memory buffer that contains exactly the
contents of a sqlite database file?

What I want to do is maintain a database as usual, but then take an
occasional snapshot, bin2c it and include it in my
(platform/OS-independent) project.

I looked for functions that would take a mmap'd file (which would be
equivalent), but didn't see anything...

-- 
Ryan Underwood, <[EMAIL PROTECTED]>

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] PLSQL

2007-03-30 Thread Dusan Gibarac
I've used both PL/SQL and PL/1. They are not related at all. P(rogramming)
L(anguage) could be used for anything. PL/1 was IBM language for mainframes,
similar to COBOL for developing application software and PL/SQL is Oracle
procedural extension of their SQL. 

Dusan Gibarac

-Original Message-
From: Ken [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 3:33 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] PLSQL

John,
 
 I've used PL/SQL on Oracle.  I think it was derived from another language,
maybe PL/1.
 
 I think its an excellent language, my main usage was geared at PL/SQL for
DBA usage that managed internal oracle objects.
 
 Pros: Packages / Procedures/ Functions have a really nice hierarchy. 
   Exception handling was excellent.
   cursor handing internaly was good.
   Record handling was good.
   
 Cons: Permission sheme was a pain. Ofter requiring direct ownership of
objects rather than through grants.
 Array handling was poor. Var arrays helped but seemed rather
cumbersome to utilize.
 
 Triggers are implemented via PL/SQL.
 
 
 
 

John Stanton <[EMAIL PROTECTED]> wrote: I am looking for advice
experienced DBMS users please.

I am currently implementing an application server using Sqlite as an 
embedded RDBMS and have a need for expanded function capability.  My 
server provides support for AJAX style WWW applications.

I have not used PLSQL to any significant degree and would be interested 
to hear pros and cons from users.  I am attracted to have a function 
language compatible with Oracle and PostgreSQL but wonder if PLSQL is 
actually a good language to create SQL functions which realise business 
rules and whether users find it easy to grasp so that they can maintain 
the PLSQL functions.  Does anyone have a better idea?

My plan is to compile the function language into a byte code and embed a 
virtual machine to execute it.  The application server already has a 
virtual machine which executes a simple language which integrates SQL, 
HTML and Javascript along with some rudimentary control structures to 
define workflow.  The function language would be used to define business 
rules and be part of a remote procedure call process used by the AJAX 
applications.

I should very much appreciate some wise counsel.

BTW, I shall make the server available if it turns out to work as planned.


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Changing column data type

2007-03-30 Thread P Kishor

add "col4 text" and

UPDATE foo SET col4 = col2


keep in mind, other than a few limitations, SQLite doesn't really give
a rip about your data types and what you store in it. It is about as
free-for-all as it gets.

On 3/30/07, Sandeep Suresh <[EMAIL PROTECTED]> wrote:

I have a table :

Table foo( col1 integer primary key, *col2 int*, col3 text )

And I want to be able to change this  to :

Table foo( col1 integer primary key, *col2  text*, col3 text )

I want to do this, because I have an "enum" in col2  and want to be able
to use custom collate function and sqlite3 doesn't allow me to use
custom collation with integers, which makes sense.

I can think of dropping and adding the table back again, any other
better ideas out there ?

TIA,
Sandeep.




--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] PLSQL

2007-03-30 Thread Ken
John,
 
 I've used PL/SQL on Oracle.  I think it was derived from another language, 
maybe PL/1.
 
 I think its an excellent language, my main usage was geared at PL/SQL for DBA 
usage that managed internal oracle objects.
 
 Pros: Packages / Procedures/ Functions have a really nice hierarchy. 
   Exception handling was excellent.
   cursor handing internaly was good.
   Record handling was good.
   
 Cons: Permission sheme was a pain. Ofter requiring direct ownership of objects 
rather than through grants.
 Array handling was poor. Var arrays helped but seemed rather 
cumbersome to utilize.
 
 Triggers are implemented via PL/SQL.
 
 
 
 

John Stanton <[EMAIL PROTECTED]> wrote: I am looking for advice experienced 
DBMS users please.

I am currently implementing an application server using Sqlite as an 
embedded RDBMS and have a need for expanded function capability.  My 
server provides support for AJAX style WWW applications.

I have not used PLSQL to any significant degree and would be interested 
to hear pros and cons from users.  I am attracted to have a function 
language compatible with Oracle and PostgreSQL but wonder if PLSQL is 
actually a good language to create SQL functions which realise business 
rules and whether users find it easy to grasp so that they can maintain 
the PLSQL functions.  Does anyone have a better idea?

My plan is to compile the function language into a byte code and embed a 
virtual machine to execute it.  The application server already has a 
virtual machine which executes a simple language which integrates SQL, 
HTML and Javascript along with some rudimentary control structures to 
define workflow.  The function language would be used to define business 
rules and be part of a remote procedure call process used by the AJAX 
applications.

I should very much appreciate some wise counsel.

BTW, I shall make the server available if it turns out to work as planned.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




Re: [sqlite] multiple request handling

2007-03-30 Thread Cesar Rodas

YEah... but every thread need to have its connection. Is not a good
idea to have a global connection and use in deferents threads.

On 30/03/07, Pavan <[EMAIL PROTECTED]> wrote:

Hi,

Does SQLite handle multiple request handling ?

Thanks,
Pavan.

--
'
Always finish stronger than you start
*




--
Cesar Rodas
http://www.cesarodas.com/
Mobile Phone: 595 961 974165
Phone: 595 21 645590
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Leonardo Mateo

On 3/30/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:

That works just fine.  It does find the file in the right directory.

The full error is :

Error in startup script: invalid command name "sqlite3"
While executing
"sqlite3 db Gem.db"


Maybe is a dumb question, but are you sure sqlite3 is in your path?
Can you run it by hand in a console? If you can, try:
$ which sqlite3
and try to set the returned path into the startup script


Hope it helps

--
Leonardo Mateo.
There's no place like ~

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] multiple request handling

2007-03-30 Thread Martin Jenkins

Pavan wrote:

Does SQLite handle multiple request handling ?


Yes.

Martin

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Reber Douglas-ra7758
That works just fine.  It does find the file in the right directory.  

The full error is :

Error in startup script: invalid command name "sqlite3"
While executing 
"sqlite3 db Gem.db"

Does this mean some option needed to be set before the .so was created?

Thanks,

Doug

-Original Message-
From: Cesar Rodas [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 2:03 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] invalid command name "sqlite3"

Can you do the next commands into your bash or you have errors?:
cd /_TOOLS/plat/lib/
ls tclsqlite-3.3.13.so

On 30/03/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:
> I have tried it on sun sparc and on linux with the same identical
> results.
>
> Thanks,
>
> Doug
>
> -Original Message-
> From: Cesar Rodas [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 30, 2007 12:31 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] invalid command name "sqlite3"
>
> what OS are you using?
>
> On 30/03/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:
> >
> > Noah,
> >
> > Thanks for the input.  I tried changing the case on both lines first
> > with the load command and then with the db access line and both
times
> I
> > get the same error.
> >
> > Any other suggestions?
> >
> > Thanks,
> >
> > Doug
> >
> > -Original Message-
> > From: Noah Hart [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 30, 2007 11:19 AM
> > To: sqlite-users@sqlite.org
> > Subject: RE: [sqlite] invalid command name "sqlite3"
> >
> > Is your operating system case sensitive?
> >
> > Try sqlite3, rather than Sqlite3
> >
> > Regards,
> >
> > Noah
> >
> > -Original Message-
> > From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 30, 2007 9:08 AM
> > To: sqlite-users@sqlite.org
> > Subject: [sqlite] invalid command name "sqlite3"
> >
> > I continue to get an invalid command name "sqlite3" with the
following
> > code:
> >
> >
> >
> > Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3
> >
> > Sqlite3 db Gem.db
> >
> >
> >
> > The source object exists correctly but it appears the API is not
> > working.  Your help is greatly appreciated.
> >
> >
> >
> > Doug Reber
> >
> >
> >
> >
> >
> > CONFIDENTIALITY NOTICE:
> > This message may contain confidential and/or privileged information.
> If
> > you are not the addressee or authorized to receive this for the
> > addressee, you must not use, copy, disclose, or take any action
based
> on
> > this message or any information herein. If you have received this
> > message in error, please advise the sender immediately by reply
e-mail
> > and delete this message. Thank you for your cooperation.
> >
> >
> >
> >
> >
>

> > -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
>

> > -
> >
> >
> >
> >
>

> -
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> >
>

> -
> >
> >
>
>
> --
> Cesar Rodas
> http://www.cesarodas.com/
> Mobile Phone: 595 961 974165
> Phone: 595 21 645590
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>

-
>
>



-- 
Cesar Rodas
http://www.cesarodas.com/
Mobile Phone: 595 961 974165
Phone: 595 21 645590
[EMAIL PROTECTED]
[EMAIL PROTECTED]


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Cesar Rodas

Can you do the next commands into your bash or you have errors?:
cd /_TOOLS/plat/lib/
ls tclsqlite-3.3.13.so

On 30/03/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:

I have tried it on sun sparc and on linux with the same identical
results.

Thanks,

Doug

-Original Message-
From: Cesar Rodas [mailto:[EMAIL PROTECTED]
Sent: Friday, March 30, 2007 12:31 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] invalid command name "sqlite3"

what OS are you using?

On 30/03/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:
>
> Noah,
>
> Thanks for the input.  I tried changing the case on both lines first
> with the load command and then with the db access line and both times
I
> get the same error.
>
> Any other suggestions?
>
> Thanks,
>
> Doug
>
> -Original Message-
> From: Noah Hart [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 30, 2007 11:19 AM
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] invalid command name "sqlite3"
>
> Is your operating system case sensitive?
>
> Try sqlite3, rather than Sqlite3
>
> Regards,
>
> Noah
>
> -Original Message-
> From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 30, 2007 9:08 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] invalid command name "sqlite3"
>
> I continue to get an invalid command name "sqlite3" with the following
> code:
>
>
>
> Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3
>
> Sqlite3 db Gem.db
>
>
>
> The source object exists correctly but it appears the API is not
> working.  Your help is greatly appreciated.
>
>
>
> Doug Reber
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> This message may contain confidential and/or privileged information.
If
> you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
on
> this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation.
>
>
>
>
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
>
>
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>
>

-
>
>


--
Cesar Rodas
http://www.cesarodas.com/
Mobile Phone: 595 961 974165
Phone: 595 21 645590
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-






--
Cesar Rodas
http://www.cesarodas.com/
Mobile Phone: 595 961 974165
Phone: 595 21 645590
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Changing column data type

2007-03-30 Thread Sandeep Suresh

I have a table :

Table foo( col1 integer primary key, *col2 int*, col3 text )

And I want to be able to change this  to :

Table foo( col1 integer primary key, *col2  text*, col3 text )

I want to do this, because I have an "enum" in col2  and want to be able 
to use custom collate function and sqlite3 doesn't allow me to use 
custom collation with integers, which makes sense.


I can think of dropping and adding the table back again, any other 
better ideas out there ?


TIA,
Sandeep.


RE: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Reber Douglas-ra7758
I have tried it on sun sparc and on linux with the same identical
results.  

Thanks,

Doug

-Original Message-
From: Cesar Rodas [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 12:31 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] invalid command name "sqlite3"

what OS are you using?

On 30/03/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:
>
> Noah,
>
> Thanks for the input.  I tried changing the case on both lines first
> with the load command and then with the db access line and both times
I
> get the same error.
>
> Any other suggestions?
>
> Thanks,
>
> Doug
>
> -Original Message-
> From: Noah Hart [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 30, 2007 11:19 AM
> To: sqlite-users@sqlite.org
> Subject: RE: [sqlite] invalid command name "sqlite3"
>
> Is your operating system case sensitive?
>
> Try sqlite3, rather than Sqlite3
>
> Regards,
>
> Noah
>
> -Original Message-
> From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 30, 2007 9:08 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] invalid command name "sqlite3"
>
> I continue to get an invalid command name "sqlite3" with the following
> code:
>
>
>
> Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3
>
> Sqlite3 db Gem.db
>
>
>
> The source object exists correctly but it appears the API is not
> working.  Your help is greatly appreciated.
>
>
>
> Doug Reber
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> This message may contain confidential and/or privileged information.
If
> you are not the addressee or authorized to receive this for the
> addressee, you must not use, copy, disclose, or take any action based
on
> this message or any information herein. If you have received this
> message in error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your cooperation.
>
>
>
>
>

> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>

> -
>
>
>
>

-
> To unsubscribe, send email to [EMAIL PROTECTED]
>
>

-
>
>


-- 
Cesar Rodas
http://www.cesarodas.com/
Mobile Phone: 595 961 974165
Phone: 595 21 645590
[EMAIL PROTECTED]
[EMAIL PROTECTED]

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Cesar Rodas

what OS are you using?

On 30/03/07, Reber Douglas-ra7758 <[EMAIL PROTECTED]> wrote:


Noah,

Thanks for the input.  I tried changing the case on both lines first
with the load command and then with the db access line and both times I
get the same error.

Any other suggestions?

Thanks,

Doug

-Original Message-
From: Noah Hart [mailto:[EMAIL PROTECTED]
Sent: Friday, March 30, 2007 11:19 AM
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] invalid command name "sqlite3"

Is your operating system case sensitive?

Try sqlite3, rather than Sqlite3

Regards,

Noah

-Original Message-
From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED]
Sent: Friday, March 30, 2007 9:08 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] invalid command name "sqlite3"

I continue to get an invalid command name "sqlite3" with the following
code:



Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3

Sqlite3 db Gem.db



The source object exists correctly but it appears the API is not
working.  Your help is greatly appreciated.



Doug Reber





CONFIDENTIALITY NOTICE:
This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.





-
To unsubscribe, send email to [EMAIL PROTECTED]

-



-
To unsubscribe, send email to [EMAIL PROTECTED]

-





--
Cesar Rodas
http://www.cesarodas.com/
Mobile Phone: 595 961 974165
Phone: 595 21 645590
[EMAIL PROTECTED]
[EMAIL PROTECTED]


RE: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Reber Douglas-ra7758
Noah,

Thanks for the input.  I tried changing the case on both lines first
with the load command and then with the db access line and both times I
get the same error.

Any other suggestions?

Thanks,

Doug

-Original Message-
From: Noah Hart [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 11:19 AM
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] invalid command name "sqlite3"

Is your operating system case sensitive?

Try sqlite3, rather than Sqlite3

Regards,

Noah 

-Original Message-
From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 9:08 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] invalid command name "sqlite3"

I continue to get an invalid command name "sqlite3" with the following
code:

 

Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3

Sqlite3 db Gem.db

 

The source object exists correctly but it appears the API is not
working.  Your help is greatly appreciated.

 

Doug Reber





CONFIDENTIALITY NOTICE: 
This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.





-
To unsubscribe, send email to [EMAIL PROTECTED]

-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] invalid command name "sqlite3"

2007-03-30 Thread Noah Hart
Is your operating system case sensitive?

Try sqlite3, rather than Sqlite3

Regards,

Noah 

-Original Message-
From: Reber Douglas-ra7758 [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 30, 2007 9:08 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] invalid command name "sqlite3"

I continue to get an invalid command name "sqlite3" with the following
code:

 

Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3

Sqlite3 db Gem.db

 

The source object exists correctly but it appears the API is not
working.  Your help is greatly appreciated.

 

Doug Reber





CONFIDENTIALITY NOTICE: 
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] invalid command name "sqlite3"

2007-03-30 Thread Reber Douglas-ra7758
I continue to get an invalid command name "sqlite3" with the following
code:

 

Load /_TOOLS/plat/lib/tclsqlite-3.3.13.so Sqlite3

Sqlite3 db Gem.db

 

The source object exists correctly but it appears the API is not
working.  Your help is greatly appreciated.

 

Doug Reber



[sqlite] PLSQL

2007-03-30 Thread John Stanton

I am looking for advice experienced DBMS users please.

I am currently implementing an application server using Sqlite as an 
embedded RDBMS and have a need for expanded function capability.  My 
server provides support for AJAX style WWW applications.


I have not used PLSQL to any significant degree and would be interested 
to hear pros and cons from users.  I am attracted to have a function 
language compatible with Oracle and PostgreSQL but wonder if PLSQL is 
actually a good language to create SQL functions which realise business 
rules and whether users find it easy to grasp so that they can maintain 
the PLSQL functions.  Does anyone have a better idea?


My plan is to compile the function language into a byte code and embed a 
virtual machine to execute it.  The application server already has a 
virtual machine which executes a simple language which integrates SQL, 
HTML and Javascript along with some rudimentary control structures to 
define workflow.  The function language would be used to define business 
rules and be part of a remote procedure call process used by the AJAX 
applications.


I should very much appreciate some wise counsel.

BTW, I shall make the server available if it turns out to work as planned.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite v/s SQLite3 Performance Assay

2007-03-30 Thread Dennis Cote

Nitin Kashyap wrote:
 
I have tried to verify for any test artifact as suggested by you; but 
still

the result were same.
Requesting for further guidance as to what can cause the slow 
responnce from

SQLite3 compared
to SQLite2.

Also, I had sent the snippet from the test driver in previous posts, 
which

can be used to derive
observation at your end, which I'm sure will concure with mine.



Nitin,

Can you supply the complete source for your test application, rather 
than just the snippets posted earlier? I would like to review your tests 
to see why this is happening.


One thing I noticed is the queries you posted are sorting the results 
since there is no suitable index, which means that sqlite is building 
temporary tables in memory prior to sorting. It is known that in memory 
tables have slowed down in sqlite3 since they have been merged with the 
normal disk based table handling code (in sqlite2 they were handled with 
special in memory tree code). This may be the cause of part of your 
speed difference.


Dennis Cote






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] multiple request handling

2007-03-30 Thread Pavan

Hi,

Does SQLite handle multiple request handling ?

Thanks,
Pavan.

--
'
Always finish stronger than you start
*


Re: [sqlite] Re: Java wrapper for both windows and linux

2007-03-30 Thread Xavier RAYNAUD

McDermott, Andrew a écrit :

Hi,
 
  
Can you elaborate on how you make this selection, and how 
  
you package 


the fragment?
  
  
=> Since fragments are host-specific, only the fragment you 
need will be loaded.
  (If you use an update site, only the fragment you need 
will be downloaded).


Note: the System property "java.library.path" is also set in 
the plugin Activator, in order to found the embedded 
dll/shared library in the right fragment.



I didn't think it was possible to change "java.library.path" after the
VM has started. If it is possible to change this value then that may
have an adverse affect on other plugins.  Or is the change isolated just
to the plugin itself?

Do you mind posting your plugin Activator that sets this property?
  


Changing this values affects all the VM, not only the plugin.
Here is a code snippet:

   // Step 1:
   // find the location of the DLL/shared library
   // In my example, it's embedded in the fragment
   // WARNING: fragment MUST NOT be packaged as a jar file !!!
   String os_name = Platform.getOS();
   String fragment_id = "org.sqlitejdbc." + os_name;
   Bundle b = Platform.getBundle(fragment_id);
   if (b == null) {
   // add error handling here.
   // however, it should never occurs.
   }

   URL fragmentUrl = b.getEntry("/");
   URL resUrl = null;
   try {
   resUrl = FileLocator.resolve(fragmentUrl);
   } catch (IOException e1) {
   // add error handling here
   // may occurs if the fragment is packaged as a jar file
   }
   String filename = resUrl.getFile();
   String protocol = resUrl.getProtocol();
   if (!"file".equals(protocol))
   {
   // add error handling here
   // may occurs if the fragment is packaged as a jar file
   }
   File fragmentFile = new File(fragmentUri);
   String fragmentPath = fragmentFile.getAbsolutePath();

   // Step 2: retrieve and update java.library.path
   String libpathvar = "java.library.path";
   String ldpathvalue = System.getProperty(libpathvar);
   ldpathvalue = fragmentPath + java.io.File.pathSeparator + 
ldpathvalue;

   System.setProperty(libpathvar, ldpathvalue);


Is it suitable for your needs ?

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Re: Java wrapper for both windows and linux

2007-03-30 Thread McDermott, Andrew
Hi,
 
> > Can you elaborate on how you make this selection, and how 
> you package 
> > the fragment?
> >   
> 
> => Since fragments are host-specific, only the fragment you 
> need will be loaded.
>   (If you use an update site, only the fragment you need 
> will be downloaded).
> 
> Note: the System property "java.library.path" is also set in 
> the plugin Activator, in order to found the embedded 
> dll/shared library in the right fragment.

I didn't think it was possible to change "java.library.path" after the
VM has started. If it is possible to change this value then that may
have an adverse affect on other plugins.  Or is the change isolated just
to the plugin itself?

Do you mind posting your plugin Activator that sets this property?

> 
> Does this answer to your question ?
> 
> 
> --
> ---
> To unsubscribe, send email to [EMAIL PROTECTED]
> --
> ---
> 
> 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Java wrapper for both windows and linux

2007-03-30 Thread Xavier RAYNAUD

Steven E. Harris a écrit :

Xavier RAYNAUD <[EMAIL PROTECTED]> writes:

  

I use native JNI libraries, and choose at runtime the native library
to open.  (on eclipse, with OS-dependant fragments, it's easy to do)



Can you elaborate on how you make this selection, and how you package
the fragment?
  


Yes, of course:
This plugin is made of 3 part:
A plugin containing just an Activator (let's say "org.sqlitejdbc")
Two platform-specific fragments containing the platform-specific jdbc 
drivers (let's say "org.sqlitejdbc.linux" and "org.sqlitejdbc.win32").

See

=> Since fragments are host-specific, only the fragment you need will be 
loaded.
 (If you use an update site, only the fragment you need will be 
downloaded).


Note: the System property "java.library.path" is also set in the plugin 
Activator, in order to found the embedded dll/shared library in the 
right fragment.


Does this answer to your question ?


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Java wrapper for both windows and linux

2007-03-30 Thread BardzoTajneKonto

> Hello All
>  iam java starter and love sqlite . when i download java wraper for sqlite
> this is good work in windows but it cant work in linux .i have this
> exception "not found libraryjsqlite.so" Althought, i download sqlite.so and
> rename to it .where is solution
 
export LD_LIBRARY_PATH=directory_with_sqlite_library:$LD_LIBRARY_PATH 
should make it work

--
Wideofelietony Tadeusza Mosza.
O biznesie dla wszystkich. Ogl±daj >> http://link.interia.pl/f1a3c


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite v/s SQLite3 Performance Assay

2007-03-30 Thread Nitin Kashyap

 "Nitin Kashyap" <[EMAIL PROTECTED]> wrote:


>
> My Intentions are towards exploring the reason behind these differences;
> and what can be done to counter these performance differences. I'm
> seeking some pointers from the Community.
>

I'm guessing that the poor performance you are getting
from SQLite3 is a test artifact of some kind.



Drh

I have tried to verify for any test artifact as suggested by you; but still
the result were same.
Requesting for further guidance as to what can cause the slow responnce from
SQLite3 compared
to SQLite2.

Also, I had sent the snippet from the test driver in previous posts, which
can be used to derive
observation at your end, which I'm sure will concure with mine.

Thanks & Regards
Nitin K


Re: [sqlite] Java wrapper for both windows and linux

2007-03-30 Thread mohsen ahmadian

Hello All
iam java starter and love sqlite . when i download java wraper for sqlite
this is good work in windows but it cant work in linux .i have this
exception "not found libraryjsqlite.so" Althought, i download sqlite.so and
rename to it .where is solution

On 3/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



> I have been unable to get this package to compile under Linux. Do you
use it
> in Linux, or Windows?

I remember I also had problem compiling this. It didnt find some
executable.
I'v downloaded missing executable, put it in PATH and there were no other
problems.
But actually it isn't necessary if you want only JNI version. By default
both
version are compiled, and most time is spent building NestedVM version -
it
is also the one that causes problems. Even if there is no single target in
the make that makes JNI version, it shouldn't be hard to remove all stuff
required for NestedVM (JNI version only needs SQlite and downloaded
source).

--
Nawet 50MB w jednym mailu >>> http://link.interia.pl/f19e7



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] Re: Python-Sqlite Unicode characters

2007-03-30 Thread Kostas5904


This is how I solved the problem (in case somebody else face it in the
future): 
...
item=dialog.GetValue()
cols="id,attr,type"
table="names1"
v="(%s, '%s', %s)" % ("null",item,3)  #the whole job is done by the ' 
%s'
a="insert into %s (%s) values %s" % (table,cols,v)

and then...

cursor.execute (a)

ATTENTION: If you work in Python you have to encode the value to utf-8, like
this:

item=dialog.GetValue().encode('utf-8')

otherwise, if you want to print "a",  you will get the following error (for
the unicode characters) :

UnicodeEncodeError: 'ascii' codec can't encode characters in position 49-56:
ordinal not in range(128)

One more time, thank you very much for your help!

Kostas

P.S. Igor you are right for the security. I am working on it...



-- 
View this message in context: 
http://www.nabble.com/Python-Sqlite-Unicode-characters-tf3486826.html#a9749435
Sent from the SQLite mailing list archive at Nabble.com.


-
To unsubscribe, send email to [EMAIL PROTECTED]
-