[sqlite] FW: Help with Porting Problem

2004-04-20 Thread Juan Romano
Hi, I am porting sqlite to vxworks.  I use the shell to issue some
simple SQL commands.   I can create a table and then I can issue insert
SQL statements, but when I try to display the data I inserted (by using
select) I always get the first record and only the first record I
inserted.  I can create a second table and try the same thing and the
same thing happens. It seems that all inserts after the first one are
getting lost.

I have had to change a number of things because of the file systems
differences. It took some work to get the files management working
(???), but obviously there is still some work there.

 

I am sure it is my doing but I am looking for some pointers as to what
area of the code I should be looking at.  I have a bunch of debug
statements but I don't see any error or anything suspicious. It appears
that the data is being written to the files, but somehow it gets lost.
May be it is the record retrieval where the problem is.

 

Any help would be greatly appreciated,

 

Thanks,

 

Juan //

 

I tried to include the trace but exceeded the MAX message size limit.
So, here are just the commands. If anybody would like to see the trace,
please let me know.

 

/***
***/

 

>sqlite_shell_main("/tffs0/testdb")

sqlite_shell_main: database filename = /tffs0/testdb

SQLite version 2.8.13

Enter ".help" for instructions

process_input: Enter

sqlite>

sqlite>

sqlite>

sqlite>

sqlite> create table autos(year smallint, make varchar(32), model
varchar(32), i

d smallint);

sqlite> .. Debug stuff omitted !

sqlite> insert into autos values(1990, 'toyota', 'corolla', 100);

sqlite> .. Debug stuff omitted !

sqlite> insert into autos values(1986, 'nissan', 'sentra', 101); 

sqlite> .. Debug stuff omitted !

sqlite> select * from autos;

sqlite_exec: Enter

sqliteOsReadLock: Enter

sqliteOsReadLock: increment nLock

sqliteOsReadLock: pLock->cnt (0x1eccc94) set to 1

sqlitepager_pagecount: Enter (file = /tffs0/testdb)

FETCH 1

sqlitepager_pagecount: Enter (file = /tffs0/testdb)

FETCH 3

1990|toyota|corolla|100

sqliteOsUnlock: pLock->cnt (0x1eccc94) set to 0

sqlite_exec: Done. rc = 0



Re: [sqlite] suggestion

2004-04-20 Thread Puneet Kishor
Mateusz Łoskot wrote:

On 4/20/2004 11:49 PM, Eli Wheaton wrote:

I'm new to sqlite but as far as I can tell it does not support ALTER 
TABLE
command. I could find that useful in future versions.


That's right.
ALTER TABLE would be very helpful.
Are there any reasons it is not implemented yet ?
Greets



my guess is because it can be done other ways (see the docs on this 
specifically), and the idea is to keep SQLite as simple as possible. The 
more "conveniences" that are added to it, the more complicated it will 
become.

Usually, once the database is set, there is little reason to ALTER it... 
it all boils down to ROI...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] suggestion

2004-04-20 Thread Mateusz Łoskot
On 4/20/2004 11:49 PM, Eli Wheaton wrote:

I'm new to sqlite but as far as I can tell it does not support ALTER TABLE
command. I could find that useful in future versions.
That's right.
ALTER TABLE would be very helpful.
Are there any reasons it is not implemented yet ?
Greets

--

Mateusz Łoskot
mateusz at loskot dot net
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] suggestion

2004-04-20 Thread Eli Wheaton
I'm new to sqlite but as far as I can tell it does not support ALTER TABLE
command. I could find that useful in future versions.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] PySqlite 0.5 on Windows 2000 SP4

2004-04-20 Thread Michal Pasternak
[ andr3a ] [Tue, Apr 20, 2004 at 07:51:54PM +0200]:
> SQLite create file and remember all operations during a single session , if
> I try to reopen file or reconnect to db used, it 'll be empty.
> Does anyone know why ? Version is 0.5.0 of PySqlite and the test is this:

... ah, and by the way, PySQLite has it's own discussion list, don't forget
it!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] PySqlite 0.5 on Windows 2000 SP4

2004-04-20 Thread Michal Pasternak
[ andr3a ] [Tue, Apr 20, 2004 at 07:51:54PM +0200]:
> SQLite create file and remember all operations during a single session , if
> I try to reopen file or reconnect to db used, it 'll be empty.
> Does anyone know why ? Version is 0.5.0 of PySqlite and the test is this:

This is normal Python DB API functionality, which involves transactions.

Either open the database in autocommit mode (and then you can use
begin/commit on your own), or do a better thing - execute cx.commit() when
you want to close the transaction (thus save the data).

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Will Version 3 allow new index features?

2004-04-20 Thread Derrell . Lipman
For future planning, might any of the new features in the upcoming Version 3
allow indexes to be used to speed up a query which uses "LIKE"?

Thanks,

Derrell

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] [Annoucement] SQLite.NET

2004-04-20 Thread Richard Heyes
Version 2.0 of (my) SQLite.NET wrapper for .NET (surprisingly) is available.
This time it's 100% C# along with full source code and VS2003 solution (with
mini test app). Comes with a script attached to the post build event to
handle the MSIL hacking necessary for the sqlite_exec callback method to be
correctly called using Cdecl convention. Also, it's now licensed under GPL.

Cheers.
-- 
Richard Heyes
http://www.phpguru.org/static/SQLite.NET.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Backing up data by date

2004-04-20 Thread Lloyd thomas
Which is the best way to backup rows which meet a certain date criteria? 
ie WHERE data is <= '2003-11-20'. 
Would I need to select and save the data to a temporary table and then DUMP the temp 
table.


[sqlite] PySqlite 0.5 on Windows 2000 SP4

2004-04-20 Thread [ andr3a ]
SQLite create file and remember all operations during a single session , if
I try to reopen file or reconnect to db used, it 'll be empty.
Does anyone know why ? Version is 0.5.0 of PySqlite and the test is this:

import sqlite
cx = sqlite.connect("myDb")
cu = cx.cursor()
cu.execute( "create table myTry( id INTEGER, myText VARCHAR(255) )" )
cu.execute( "insert into myTry values( 1, 'try 1' )" )
cu.execute( "insert into myTry values( 2, 'try 2' )" )

cu.execute( "SELECT sql FROM sqlite_master WHERE type='table'" )
print cu.fetchone()
# ('create table myTry( id INTEGER, myText VARCHAR(255) )',)

cu.execute( "SELECT * from myTry" )
print cu.fetchone()
# (1, 'try 1')
print cu.fetchone()
# (2, 'try 2')



... then I try to reconnect ... with another file to the same database file
...

import sqlite
cx = sqlite.connect("myDb")
cu = cx.cursor()
cu.execute( "SELECT sql FROM sqlite_master WHERE type='table'" )
print cu.fetchone()
# None


The strange thing is tht it seems works fine before I used cx.close() for
another test ...



[sqlite] Timeframe for 3.0 ?

2004-04-20 Thread VTenneti




Hi,

We're considering the use of SQLite in the next version of our Doc1
product. SQLite does seem the ideal embedded database for us to use.
However, there seem to a couple of thorny issues, and can someone please
throw some light on they could possibly be resolved:

1. Our product is Unicode (in fact we recently ported the code over from
DBCS). I see from the ongoing discussions that supporting Unicode is
something that is planned for SQLite 3.0. So what is the timeframe for 3.0
? How easy / difficult may it turn out to be to change the code ourselves ?
We may need to start the work very soon.

2. Our product allows users to write logic by dragging and dropping visual
elements on the front end - and as part of that, we have our own datatypes
(for example Integer, Fixed Point Number (proprietary format), String,
Date, Time). So the fact that SQLite is typeless may turn out to be an
advatage - but we would need to 'override', for example, arithmetic and
comparison functions to use our own code. How easy or difficult may that
turn out to be ?

I probably should mention that our runtime engine (virtual machine) runs on
a multitude of platforms from  Windows to several flavours of Unix to MVS.

Thanks a lot,

Vijay


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] A proposal for SQLite version 3.0

2004-04-20 Thread Mikhail Fedotov
Hi!

>SQLite is very storage efficient in the common case.  In a typical table,
SQLite will use
>about 4 or 5 bytes of disk space for every 3 bytes of actual data stored.
Put another
>way, about 60% to 75% of an SQLite database file is the actual data being
stored
>and the other 40% to 25% is overhead.

>If you have an example where the overhead is significantly larger than
this, I'd be interested in seeing it.

I had such example. I had records which were taking just a bit more than
half of the
page, so that the second half of the page was just wasted. This gives around
100% overhead.

I've changed the page size to be much larger and the problem almost
disappeared,
but such database requires modified version of sqlite.

It would be great if a newer version of sqlite will be able to create
databases with
the specified page size and to detect that page size on opening (or at least
open the database with explicitly specified page size).

Mikhail



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]