[sqlite] SQLiteJDBC is now 100% Pure Java

2006-12-12 Thread David Crawshaw

For several months now I have been providing a Java JDBC driver for
SQLite 3. Now I am happy to announce with v030, the completion of a
100% Pure Java version.

http://www.zentus.com/sqlitejdbc

This is accomplished with the support of the great NestedVM project.
The SQLite C source is compiled by gcc to a MIPS binary, that is then
dynamically interpreted on top of the Java runtime. This involves a
performance hit but greatly simplifies inclusion in current projects
and delivery cross-platform.

The native JNI version has not been abandoned, and binaries are still
provided for Windows and Mac OS X. Linux can be directly compiled.

The new native version has been extensively tested, with the only
major caveat at the moment being the size of the binary. I believe it
can be greatly reduced from the current ~ 800kb, I just do not have
the time.

I hope someone finds this useful. The code is all under a BSD license.

d

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



Re: [sqlite] faster SELECT time on second run

2006-12-12 Thread John Stanton
If you want to get as much as possible of the Sqlite database into 
physical memory on the computer, read all of it.  If you just want to 
preload the cache and VM so that the first user gets faster response 
execute a dummy query like one you would expect the first user to run.


Since the VM logic will work on a least recently used algorithm the 
preload using a read of the file will not be very successful if you have 
a huge database and not much physical memory.  You will only have the 
tail of the DB in physical memory.


My preference would be to execute a dummy query as part of the DB open. 
 That would leave the cache primed with a working set of pages likely 
to satisfy the first user query.  After that the cache takes care of 
itself.  This method not only primes the Sqlite cache but also makes the 
pages resident in physical memory.  Reading the file alone does not 
prime the Sqlite cache.


Kees Nuyt wrote:

On Mon, 11 Dec 2006 19:50:52 -0600, John Stanton wrote:



Use a Unix read or a Windows API ReadFile and read the whole file
in one call. 
Find the size of it using a Unix lseek or

Win32 API GetFileSize call.  You will certainly
pull the whole file into VM that way.



Would that be wise for a database larger than a few tens of
MegaBytes? I guess it could cause some serious swapping,
invalidate hardware disk caches again, and make the rest of the
system slow...

The large block (does Visual Basic support such a large 'blob'
variable?) you'd read would be in Virtual Memory all right, but
as there is no relation between a large variable in memory and
the sqlite database, any database access would cause pages to be
read from disk again, the memory would not be used, only
hardware- and software diskcaches.

Read/discard in 64 kByte chunks seems just a little better, that
could still load the database in the OS disk cache, depending on
the disk cache size, and VM strategy settings of the system.
Defining a large sqlite database page cache and prefilling it
with the most frequently used pages by executing a carefully
crafted query would be a better answer, but that only helps when
the database is kept open all the time.

Frankly, I wouldn't bother; I'd just define a large sqlite cache
and a suitable database page size and have the first user /
process digest the initial delay. If the database isn't used for
a while on an otherwise busy system, disk caches would quickly
be reused by something else anyway. 




Jay Sprenkle wrote:


On 12/11/06, Dennis Cote <[EMAIL PROTECTED]> wrote:



Simply read the entire file once using fread when you open the database.
That will load the entire file in to the OS cache so that when SQLite
starts reading the file, the required disk blocks are already in memory.
The result is the same fast lookups that you see in SQLite the second
time you run a query. The additional read is also quite fast since it
reads the file sequentially from start to finish with no seeking,
whereas SQLite will seek back and forth as it reads database pages into
memory.



You probably can't fseek() to the end and get the same effect?

You could do this in vb6 by writing a loop and using "input #1"
and discarding what was read. In vb.net it's much simpler using
a file stream reader.

--
The JS Image Collector suite:
http://groups-beta.google.com/group/js-image-collector?hl=en

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

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



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



Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread John Stanton

Could be an FTP in ASCII mode copy problem.

[EMAIL PROTECTED] wrote:

"Rob Coenen" <[EMAIL PROTECTED]> wrote:


yes that is what I tried; I did use sqlite3
does not work. Any known problems on moving db files from Win to Linux?




SQLite database files are cross-platform.  They work on linux,
windows, mac, various embedded platforms, etc.  Byte order does
not matter either.

Perhaps the file was corrupted by whatever utility you used to 
"move" it from win to Linux?  Perhaps \n got converted to \r\n
or something. Can you compare the md5 checksum of the file 
before and after moving it?


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


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




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



Re: [sqlite] multiple order by value bug?

2006-12-12 Thread Will Leshner

On 12/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


No, I accomodate only te kereset.datum colum to the ORDER BY clause, and
then the result come wrong.


Ah. Ok. Sorry for the confusion.

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



RE: [sqlite] multiple order by value bug?

2006-12-12 Thread Fred Williams
I also have an issue with "Order By" with one of my queries as well.  I am 
doing a multi field Order By and the second of the two fields does not sort in 
the correct order.  I do not have the code in front of me, so can't supply any 
details.

I have been killing bigger alligators on that project so the Order By issue is 
on the "to do" list.  I just figured it was my Select statement, although it is 
pretty straight forward, as I remember.  Perhaps there is a bug report in the 
making.

Fred

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 12, 2006 2:41 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] multiple order by value bug?
> 
> 
> Will Leshner írta: 
> 
> > On 12/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: 
> > 
> >> This query works fine (I think my collate function too), but if I 
> >> accomodate
> >> it with "ORDER BY szemely.nev,szemely.anyanev,kereset.datum", then 
> >> sorting
> >> is in wrong order.
> > 
> > Do you mean you have two "ORDER BY" clauses? Seems like 
> that would be
> > a syntax error, or, at best, undefined.
> 
> No, I accomodate only te kereset.datum colum to the ORDER BY 
> clause, and 
> then the result come wrong. 
> 
> The two columns (szemely.nev,szemely.anyanev) collated by my 
> func, and the 
> third column that I accomodate is collated by the default 
> sqlite func. 
> 
> I want to sort by szemely.nev and when szemely nev is equal, sort by 
> szemely.anyanev. Then I would like to sort the result by 
> kereset.datum. 
> 
> nev|anyanev|datum
> 1. aaa|bbb|111
> 2. aaa|bbb|112
> 3. aaa|bbc|111
> 4. aaa|bbc|112 
> 
> 
> regards
>  ---
> kiru
>  
> 
> --
> ---
> To unsubscribe, send email to [EMAIL PROTECTED]
> --
> ---
> 


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



Re: [sqlite] Copy Table Values

2006-12-12 Thread Rich Shepard

On Tue, 12 Dec 2006, [EMAIL PROTECTED] wrote:


INSERT INTO ... SELECT ...


  A-ha! Thank you very much.

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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



Re: [sqlite] Copy Table Values

2006-12-12 Thread drh
Rich Shepard <[EMAIL PROTECTED]> wrote:
> I want to copy field values for two columns in one table into the
> equivalent columns in another table. I don't find a 'select ... into' option
> in the web page syntax for the command. How should I go about doing this
> data copy?
> 

INSERT INTO ... SELECT ...
--
D. Richard Hipp  <[EMAIL PROTECTED]>


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



[sqlite] Copy Table Values

2006-12-12 Thread Rich Shepard

  I want to copy field values for two columns in one table into the
equivalent columns in another table. I don't find a 'select ... into' option
in the web page syntax for the command. How should I go about doing this
data copy?

Thanks,

Rich

--
Richard B. Shepard, Ph.D.   |The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)|Accelerator
 Voice: 503-667-4517  Fax: 503-667-8863

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



Re: [sqlite] multiple order by value bug?

2006-12-12 Thread kiru
Will Leshner írta: 

On 12/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: 

This query works fine (I think my collate function too), but if I 
accomodate
it with "ORDER BY szemely.nev,szemely.anyanev,kereset.datum", then 
sorting

is in wrong order.


Do you mean you have two "ORDER BY" clauses? Seems like that would be
a syntax error, or, at best, undefined.


No, I accomodate only te kereset.datum colum to the ORDER BY clause, and 
then the result come wrong. 

The two columns (szemely.nev,szemely.anyanev) collated by my func, and the 
third column that I accomodate is collated by the default sqlite func. 

I want to sort by szemely.nev and when szemely nev is equal, sort by 
szemely.anyanev. Then I would like to sort the result by kereset.datum. 


nev|anyanev|datum
1. aaa|bbb|111
2. aaa|bbb|112
3. aaa|bbc|111
4. aaa|bbc|112 



regards
---
kiru


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



[sqlite] creating indices from my app vs sqlite3.exe

2006-12-12 Thread Dan Baker

___BACKUP INFO___
I've got a single database, with about 10,000 records (the file is 944KB). 
I have a feature that will re-populate the database from external disk 
files.  If the database is already populated, then the feature just walks 
the disk files and validates that each file is already in the database.  IF 
I have good indices, the feature takes about 5 seconds to run.  IF I have 
bad indices, the feature takes about 2-5 minutes to run.



___PROBLEM INFO___
If I create 1 index from my app, the feature runs fast.
CREATE INDEX foldername_index ON cabs (foldername);

If I create 2 indices from my app, the feature runs REAL slow.
CREATE INDEX foldername_index ON cabs (foldername);
CREATE INDEX cuid_index ON cabs (cuid,duid);

If I create 1 or 2 indices from sqlite3.exe on my database, then the feature 
runs REAL FAST!



___WRAP UP___
I've been working on this all day, with little success to deterine the 
difference.  Any ideas?


My app does the following, on an already populated database:
Note: I'm using "CppSQLite3" as a wrapper.

sqlite3_exec(m_pDB, "CREATE INDEX foldername_index ON cabs (foldername);", 
0, 0, &err);
sqlite3_exec(m_pDB, "CREATE INDEX cuid_index ON cabs (cuid,duid);", 0, 0, 
&err);



Any ideas why the creation of the SECOND index makes everything stop working 
right?


Thanks
DanB


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



Re: [sqlite] sqlite3 close() run time errors

2006-12-12 Thread Dennis Cote

Michele Santucci wrote:
I used borland IMPLIB import tool with -a attribute (this add the 
leading underscore
for cdecl compliance). If I didn't use this flag I got linking error 
about missing references...

this's a run-time error not a linker error.


Michele,

This is a problem I discovered with Borland IMPLIB. The fix I found is 
described under ticket 1291 at http://www.sqlite.org/cvstrac/tktview?tn=1291


For some reason implib doesn't generate the correct  symbols when 
converting directly from the dll file.


HTH
Dennis Cote

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



Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread Kees Nuyt
On Tue, 12 Dec 2006 19:25:16 +0100, you wrote:

>ok - I was trying to do somthing like this, but I could not find any sample?

sqlite3 olddatabasefile .dump >transportfile
[transfer transportfile in binary mode]
sqlite3 newdatabasefile On 12/12/06, jose isaias cabrera <[EMAIL PROTECTED]> wrote:
>>
>> "Rob Coenen" wrote,
>>
>>
>> > hello all,
>> >
>> > I have been using TRAC for Windows and I need to restore the TRAC wiki
>> on
>> > a
>> > Linux machine.
>> >
>> > The integrated Trac WIKI is stored in a sqlite file, it seems as sqlite
>> > version 3 (judging by opening the .db file with a HEX editor, the header
>> > mentions sqlite 3).
>> >
>> > I can read the file on Window with sqlite but I cannot read the same
>> file
>> > when I copy it to my Linux machine. It says that the file is not a
>> > database
>> > or that it is encrypted.
>> >
>> > Any help here?
>> >
>> The first thing that comes to mind is to dump the database to text and
>> then,
>> open a new one in unix and import it.
>>
>> just thinking...
>>
>>
>>
>> -
>> To unsubscribe, send email to [EMAIL PROTECTED]
>>
>> -
>>
>>
-- 
  (  Kees Nuyt
  )
c[_]

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



[sqlite] Re: Re: Loss of table feature.. ever?

2006-12-12 Thread Igor Tandetnik

Edwin Knoppert <[EMAIL PROTECTED]> wrote:

Yes but imo a rather daunting task.
I better leave it to the author of sqlite :)


You can download SQLite source code and check the implementation. I 
expect sqlite3_get_table is implemented in a couple dozen lines of code.


Igor Tandetnik


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



[sqlite] building sqlite on windows in Unicode

2006-12-12 Thread Brodie Thiesfield
Hi,

Building sqlite on windows in Unicode mode broke with the addition of
the loadable extensions. I found a bug matching this problem and
attached a patch to it to fix it a while ago, however I haven't seen any
other comments or movement in the bug. I'm not sure what else needs to
be done to have a patch accepted, so I'm posting here in the hope to
prod it along for review or acceptance.

The problem is that the dlopen/LoadLibrary code looks like it was hacked
in instead of being added to the platform abstraction API and it doesn't
support windows unicode builds out of the box. The patch fixes that
problem and silences a warning generated by the new index format.

bug...
http://www.sqlite.org/cvstrac/tktview?tn=2023

patch...
http://www.sqlite.org/cvstrac/attach_get/309/sqlite3.patch

Regards,
Brodie

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



Re: [sqlite] faster SELECT time on second run

2006-12-12 Thread Kees Nuyt

On Mon, 11 Dec 2006 19:50:52 -0600, John Stanton wrote:

> Use a Unix read or a Windows API ReadFile and read the whole file
> in one call. 
> Find the size of it using a Unix lseek or
> Win32 API GetFileSize call.  You will certainly
> pull the whole file into VM that way.

Would that be wise for a database larger than a few tens of
MegaBytes? I guess it could cause some serious swapping,
invalidate hardware disk caches again, and make the rest of the
system slow...

The large block (does Visual Basic support such a large 'blob'
variable?) you'd read would be in Virtual Memory all right, but
as there is no relation between a large variable in memory and
the sqlite database, any database access would cause pages to be
read from disk again, the memory would not be used, only
hardware- and software diskcaches.

Read/discard in 64 kByte chunks seems just a little better, that
could still load the database in the OS disk cache, depending on
the disk cache size, and VM strategy settings of the system.
Defining a large sqlite database page cache and prefilling it
with the most frequently used pages by executing a carefully
crafted query would be a better answer, but that only helps when
the database is kept open all the time.

Frankly, I wouldn't bother; I'd just define a large sqlite cache
and a suitable database page size and have the first user /
process digest the initial delay. If the database isn't used for
a while on an otherwise busy system, disk caches would quickly
be reused by something else anyway. 

>Jay Sprenkle wrote:
>> On 12/11/06, Dennis Cote <[EMAIL PROTECTED]> wrote:
>> 
>>>
>>> Simply read the entire file once using fread when you open the database.
>>> That will load the entire file in to the OS cache so that when SQLite
>>> starts reading the file, the required disk blocks are already in memory.
>>> The result is the same fast lookups that you see in SQLite the second
>>> time you run a query. The additional read is also quite fast since it
>>> reads the file sequentially from start to finish with no seeking,
>>> whereas SQLite will seek back and forth as it reads database pages into
>>> memory.
>> 
>> 
>> You probably can't fseek() to the end and get the same effect?
>> 
>> You could do this in vb6 by writing a loop and using "input #1"
>> and discarding what was read. In vb.net it's much simpler using
>> a file stream reader.
>> 
>> -- 
>> The JS Image Collector suite:
>> http://groups-beta.google.com/group/js-image-collector?hl=en
>> 
>> SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
>> http://www.reddawn.net/~jsprenkl/Sqlite
>> 
>> Cthulhu Bucks!
>> http://www.cthulhubucks.com
-- 
  (  Kees Nuyt
  )
c[_]

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



Re: [sqlite] Re: Loss of table feature.. ever?

2006-12-12 Thread Edwin Knoppert

Yes but imo a rather daunting task.
I better leave it to the author of sqlite :)


- Original Message - 
From: "Igor Tandetnik" <[EMAIL PROTECTED]>

To: "SQLite" 
Sent: Tuesday, December 12, 2006 8:01 PM
Subject: [sqlite] Re: Loss of table feature.. ever?



Edwin Knoppert <[EMAIL PROTECTED]> wrote:

Hello people, i really need to ask this thing again.
My visual design tool has a custom written datacontrol for sqlite.
This means MoveFirst, Previous, next and movelast buttons.

This control depends heavily on the gettable() sqlite functions.

While i already understand that these functions are deprecated and we
should use the prepare stuff.
I do that already except for this control.
At this time the prepare stuff does not seem to work the same as the
table stuff.
Like moveprevious and such?


sqlite3_get_table simply loads the whole resultset into memory. You can do 
that with sqlite3_prepare et al just as well. In fact, sqlite3_get_table 
is implemeted in terms of sqlite3_prepare, sqlite3_step and so on.


Igor Tandetnik

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





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



[sqlite] Re: Loss of table feature.. ever?

2006-12-12 Thread Igor Tandetnik

Edwin Knoppert <[EMAIL PROTECTED]> wrote:

Hello people, i really need to ask this thing again.
My visual design tool has a custom written datacontrol for sqlite.
This means MoveFirst, Previous, next and movelast buttons.

This control depends heavily on the gettable() sqlite functions.

While i already understand that these functions are deprecated and we
should use the prepare stuff.
I do that already except for this control.
At this time the prepare stuff does not seem to work the same as the
table stuff.
Like moveprevious and such?


sqlite3_get_table simply loads the whole resultset into memory. You can 
do that with sqlite3_prepare et al just as well. In fact, 
sqlite3_get_table is implemeted in terms of sqlite3_prepare, 
sqlite3_step and so on.


Igor Tandetnik 



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



[sqlite] Loss of table feature.. ever?

2006-12-12 Thread Edwin Knoppert

Hello people, i really need to ask this thing again.
My visual design tool has a custom written datacontrol for sqlite.
This means MoveFirst, Previous, next and movelast buttons.

This control depends heavily on the gettable() sqlite functions.

While i already understand that these functions are deprecated and we should 
use the prepare stuff.

I do that already except for this control.
At this time the prepare stuff does not seem to work the same as the table 
stuff.

Like moveprevious and such?

I don't mind, the table stuff is good for me, i'm only want to let you know 
that some of us are depending on this stuff.


Hope you'll leave this part in?

Thanks!


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



Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread drh
"Rob Coenen" <[EMAIL PROTECTED]> wrote:
> yes that is what I tried; I did use sqlite3
> does not work. Any known problems on moving db files from Win to Linux?
> 

SQLite database files are cross-platform.  They work on linux,
windows, mac, various embedded platforms, etc.  Byte order does
not matter either.

Perhaps the file was corrupted by whatever utility you used to 
"move" it from win to Linux?  Perhaps \n got converted to \r\n
or something. Can you compare the md5 checksum of the file 
before and after moving it?

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


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



Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread Rob Coenen

ok - I was trying to do somthing like this, but I could not find any sample?

On 12/12/06, jose isaias cabrera <[EMAIL PROTECTED]> wrote:




"Rob Coenen" wrote,


> hello all,
>
> I have been using TRAC for Windows and I need to restore the TRAC wiki
on
> a
> Linux machine.
>
> The integrated Trac WIKI is stored in a sqlite file, it seems as sqlite
> version 3 (judging by opening the .db file with a HEX editor, the header
> mentions sqlite 3).
>
> I can read the file on Window with sqlite but I cannot read the same
file
> when I copy it to my Linux machine. It says that the file is not a
> database
> or that it is encrypted.
>
> Any help here?
>
The first thing that comes to mind is to dump the database to text and
then,
open a new one in unix and import it.

just thinking...



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread Rob Coenen

yes that is what I tried; I did use sqlite3
does not work. Any known problems on moving db files from Win to Linux?

On 12/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


"Rob Coenen" <[EMAIL PROTECTED]> wrote:
> hello all,
>
> I have been using TRAC for Windows and I need to restore the TRAC wiki
on a
> Linux machine.
>
> The integrated Trac WIKI is stored in a sqlite file, it seems as sqlite
> version 3 (judging by opening the .db file with a HEX editor, the header
> mentions sqlite 3).
>
> I can read the file on Window with sqlite but I cannot read the same
file
> when I copy it to my Linux machine. It says that the file is not a
database
> or that it is encrypted.
>
> Any help here?

Use "sqlite" to read an sqlite version 2 database.  Use "sqlite3"
to read a version 3 database.
--
D. Richard Hipp  <[EMAIL PROTECTED]>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread jose isaias cabrera



"Rob Coenen" wrote,



hello all,

I have been using TRAC for Windows and I need to restore the TRAC wiki on 
a

Linux machine.

The integrated Trac WIKI is stored in a sqlite file, it seems as sqlite
version 3 (judging by opening the .db file with a HEX editor, the header
mentions sqlite 3).

I can read the file on Window with sqlite but I cannot read the same file
when I copy it to my Linux machine. It says that the file is not a 
database

or that it is encrypted.

Any help here?

The first thing that comes to mind is to dump the database to text and then, 
open a new one in unix and import it.


just thinking...


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



Re: [sqlite] sqllite ddb from win to linux

2006-12-12 Thread drh
"Rob Coenen" <[EMAIL PROTECTED]> wrote:
> hello all,
> 
> I have been using TRAC for Windows and I need to restore the TRAC wiki on a
> Linux machine.
> 
> The integrated Trac WIKI is stored in a sqlite file, it seems as sqlite
> version 3 (judging by opening the .db file with a HEX editor, the header
> mentions sqlite 3).
> 
> I can read the file on Window with sqlite but I cannot read the same file
> when I copy it to my Linux machine. It says that the file is not a database
> or that it is encrypted.
> 
> Any help here?

Use "sqlite" to read an sqlite version 2 database.  Use "sqlite3"
to read a version 3 database.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


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



[sqlite] sqllite ddb from win to linux

2006-12-12 Thread Rob Coenen

hello all,

I have been using TRAC for Windows and I need to restore the TRAC wiki on a
Linux machine.

The integrated Trac WIKI is stored in a sqlite file, it seems as sqlite
version 3 (judging by opening the .db file with a HEX editor, the header
mentions sqlite 3).

I can read the file on Window with sqlite but I cannot read the same file
when I copy it to my Linux machine. It says that the file is not a database
or that it is encrypted.

Any help here?


Re: [sqlite] multiple order by value bug?

2006-12-12 Thread Will Leshner

On 12/12/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


This query works fine (I think my collate function too), but if I accomodate
it with "ORDER BY szemely.nev,szemely.anyanev,kereset.datum", then sorting
is in wrong order.


Do you mean you have two "ORDER BY" clauses? Seems like that would be
a syntax error, or, at best, undefined.

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



[sqlite] multiple order by value bug?

2006-12-12 Thread info
Hi list, 



sqlite version: 3.3.8 

I have 2 tables: 


---
CREATE TABLE kereset (realid INTEGER NOT NULL, id INTEGER NOT NULL, datum 
DATETIME, jogcim CHAR(1) NOT NULL, brutto INT NOT NULL, ado INT NOT NULL, 
adoalap INT NOT NULL); 

CREATE TABLE szemely (id INTEGER NOT NULL, nev VARCHAR(128) NOT NULL COLLATE 
MAGYAR, leanynev VARCHAR(128) COLLATE MAGYAR, anyanev VARCHAR(128) COLLATE 
MAGYAR, szulhely VARCHAR(128) COLLATE MAGYAR, szuldat DATETIME, adoszam 
VARCHAR(10), irszam INT, varos VARCHAR(64) COLLATE MAGYAR, cim VARCHAR(128) 
COLLATE MAGYAR, telefon VARCHAR(64), adoalap INT, adosav INT, szolgdij INT, 
torolve BOOLEAN DEFAULT FALSE);
--- 


my query:
---
SELECT szemely.nev, szemely.anyanev, szemely.szulhely, szemely.adoszam, 
kereset.datum,szemely.id FROM szemely,kereset WHERE (kereset.datum >= 
19950101 AND kereset.datum <= 19951231) AND (szemely.nev >= '000' AND 
szemely.nev <= 'zzz') AND kereset.id = szemely.id ORDER BY 
szemely.nev,szemely.anyanev
--- 

This query works fine (I think my collate function too), but if I accomodate 
it with "ORDER BY szemely.nev,szemely.anyanev,kereset.datum", then sorting 
is in wrong order. 

If you need it, I send my collate function. 


regards
---
kiru


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



[sqlite] update across multiple tables

2006-12-12 Thread Chris Hoy
Hi 
I have the following update statements that work fine on mysql. I understand
that sqllite will not do the table join so how would I do this update
without resorting to multiple sub-queries 

UPDATE shopstatistics as s, Temp_Shop_Stats_1 as Temp
SET
  s.nbrdailiesmorning = Temp.nbrdailiesmorning,
  s.nbrdailiesevening = Temp.nbrdailiesevening,
  s.nbrweeklies = Temp.nbrweeklies,
  s.nbrmonthlies = Temp.nbrmonthlies,
  s.nbrothers = Temp.nbrothers,
  s.valuedailiesmorning = Temp.valuedailiesmorning,
  s.valuedailiesevening = Temp.valuedailiesevening,
  s.valueweeklies = Temp.valueweeklies,
  s.valuemonthlies = Temp.valuemonthlies,
  s.valueothers = Temp.valueothers
WHERE
s.day = Temp.day and s.shopid = Temp.shopid and s.phase = 0;


Chris Hoy
 
 




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



Re: [sqlite] sqlite3 close() run time errors

2006-12-12 Thread Roberto

On 12/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote:

this's a run-time error not a linker error.


It's a runtime error cos it is linked incorrectly!

Specify the sqlite.def file (which IIRC lists the undecorated aliases
of the sqlite functions) as an option to the command line of implib.

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



Re: [sqlite] sqlite3 close() run time errors

2006-12-12 Thread Trevor Talbot

On 12/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote:


this's a run-time error not a linker error.


It sounds like a load time error.  If that's the case, and it is the
Windows loader, then your import tool did not do translation
correctly: it's looking for the literal name "_sqlite3_open" in the
DLL exports.  Such a name does not exist.

The Microsoft import library format sets up name translations, where
the underscore is supplied for the usual linking mechanisms, but the
linker is also instructed to place the undecorated name in the
dependency table.  You want to have your tool do the same thing.
Failing that, look for a way to have the compiler not apply
decorations to dllimport function declarations.

One of those must be supported, since it would be required to use
Windows API functions (stdcall has a decoration format of its own).

Failing that, give up on the stock dll and build your own, or compile
sqlite directly into your project :)

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



Re: [sqlite] sqlite3 close() run time errors

2006-12-12 Thread Michele Santucci
See the answer to 'Roberto' in the same thread I create the .lib trough 
Borland

IMPLIB with the proper flag to add leading _underscores.

- Original Message - 
From: "Marten Feldtmann" <[EMAIL PROTECTED]>

To: 
Sent: Monday, December 11, 2006 3:55 PM
Subject: Re: [sqlite] sqlite3 close() run time errors



Michele Santucci schrieb:

Hello,

I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev 
tool). I took the last sqlite3 dll and source.
I create the .lib file linked it to the binary and included the sqlite3.h 
file... but as long as I start the application I got an error about a 
missing entry point of the _sqlite3_close() function... why?


Calling convention and name decoration. Your linker knows, that 
sqlite3_close() has to be called via cdecl
calling convention and does not look for sqlite_close(), but for 
_sqlite_close().


You have to tell your IDE, Linker - that it should not use naming 
decoration.


Marten

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


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.15/581 - Release Date: 
09/12/2006 15.41






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



Re: [sqlite] sqlite3 close() run time errors

2006-12-12 Thread Michele Santucci
I used borland IMPLIB import tool with -a attribute (this add the leading 
underscore
for cdecl compliance). If I didn't use this flag I got linking error about 
missing references...

this's a run-time error not a linker error.

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

To: 
Sent: Monday, December 11, 2006 3:59 PM
Subject: Re: [sqlite] sqlite3 close() run time errors



You are probably linking against exports with a leading underscore.
(The exports of sqlite3.dll don't have the _underscore). Does your dev
environment/linker have the option to disable this underscore
generation?

On 11/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote:

Hello,

I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev 
tool). I took the last sqlite3 dll and source.
I create the .lib file linked it to the binary and included the sqlite3.h 
file... but as long as I start the application I got an error about a 
missing entry point of the _sqlite3_close() function... why?

May depends on mscvrt dependancies?

Distinti saluti,

 Michele Santucci
=
Software Development Manager
*
Celin Avio s.r.l.
*
tel. +39-0187933876
fax +39-0187933654
web: http://www.celinavio.it
=



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


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.15/581 - Release Date: 
09/12/2006 15.41






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



Re: [sqlite] cursor question

2006-12-12 Thread John Stanton
Cursors as such are not implemented.  You can achieve the function of a 
cursor from Sqlite with some thought.


Jim Crafton wrote:

Does the latest version of sqlite have cursors? If so, where might I
find docs on using them?

Thanks

Jim C

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






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