[sqlite] Why this SQL does not work?

2004-11-11 Thread WeiChin3
Hi,
 
I have two tables:
 
CREATE TABLE A (
ID  integer primary key,
SERVER_ID integer
)

CREATE TABLE B (
ID integer primary key,
GROUP_ID integer,
SERVER_ID integer 
)
 
The following SQL does not  work, complaint is "Error: no such column: 
B.GROUP_ID"


select ID, 
(select  SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
from B
 
I realize that I can do it  in other ways to make it work. However, anyone 
has an explanation why this SQL  does not work with SQLITE? It works with MYSQL 
and MS ACCESS.
 
Thanks in  advance.
 
Wei




Re: [sqlite] Problems with SQLite and XP SP2

2004-10-28 Thread WeiChin3
 
In a message dated 10/28/2004 2:04:14 PM Eastern Daylight Time,  
[EMAIL PROTECTED] writes:

After  installation SP2 for XP Home on Toshiba notebook my application (VC++
6.0)  working width SQLite (2.8.15) data base (30 000 records, 30 MB) goes
crazy.  Is nearly frozen, all virtual memory is allocated (~800MB), but  Task
Manager reports that my application process gets 8MB - so as ususal.  Who
took the rest? ;)
So I uninstall SP2 and everything is fine now,  again.

But what could be the problem? Probably not SQLite itself,  but...
On another machine (standalone XP SP2) the same application and data  base
file works ok.
The application itself is quite simple VC++ 6.0 MFC  application. Works fine
for a 2 years till  now...






Adware/spyware could be the culprit here, run spybot and see what it  reports 
_http://www.safer-networking.org/en/download/_ 
(http://www.safer-networking.org/en/download/) 
 
Wei
 


Re: [sqlite] In-Memory Performance Comparisons

2004-09-23 Thread WeiChin3
 
In a message dated 9/23/2004 7:55:20 AM Eastern Daylight Time,  
[EMAIL PROTECTED] writes:

Can anyone tell me (or  point me to any documentation) about the differences 
in speed between using an  on-disk DB and an in-memory one?



The speed difference would depends on how you use the database.
 
If you use the default mode, which is synchronous=full, and do a lot of  
insert/update/delete without transaction, you can gain speed 100 folder by using  
a in-memory database.
 
However, if you do a lot of insert/update/delete, but wrap them in a  
transaction, then the performance gain is much much less.
 
Wei
 
 
 
 


Re: [sqlite] Newbie's first question about using SQLite in C++

2004-09-10 Thread WeiChin3



jb,
 
download the sqlite-source-3_0_6.zip file from http://www.sqlite.org/download.html. 
unzip it. build with the attached VC project file, you will end up with a 
sqlite3.lib static library.
 
You can build your project with this library and sqlite3.h file. These two 
files are all you need.
 
good luck.
 
wei
























































































































































Re: [sqlite] Version 3.0.6 (beta) Was: [sqlite] Locking in 3.0.5

2004-09-02 Thread WeiChin3
 
In a message dated 9/2/2004 1:02:17 PM Eastern Daylight Time, [EMAIL PROTECTED]  
writes:

Version  3.0.6 is on the website now.


Dr. Hipp,
 
Thanks for moving so fast, I will pull and test.
 
A question, is there an easy way to corrupt a database for testing  purposes? 
such as change some bytes using a binary editor.
 
I am trying to test the code that handle corrupted database, I assume  that  
SQLITE_CORRUPT will be returned when this happens.
 
Wei
 


Re: [sqlite] Database Locking

2004-06-04 Thread WeiChin3
 
In a message dated 6/4/2004 11:53:05 AM Eastern Daylight Time,  
[EMAIL PROTECTED] writes:

I'm  using SQLite on a Windows XP system with 1GB of RAM. I'm writing a 
server  which spawns multiple threads for it's connections. It is 
querying and  writing to an SQLite database within each thread. Whenever 
a query or  insert/update statement is issued, the SQLite database is 
opened,  queried/written to, and closed again. When a bunch of queries 
come in  (about 10 in a second, for instance), SQLite reports that the 
database is  locked despite my setting the sqlite_busy_timeout to 150 or 
so. Certain  database writes thus do not take place, which is a major 
problem. If I  detect when my call returns SQLITE_BUSY and sleep for a 
while (about 100  ms) and re-try the call, it continuously says that the 
database is  locked.



I have an application basically does the same thing and retry after  
SQLITE_BUSY works like a champ. So I would say the problem is not sqlite but  your 
implementation. Maybe you can post your busy-retry code so I can take a  look and 
make suggestion?
 
Wei