[sqlite] any way to find out how many current connections to db?

2007-08-11 Thread Chase


is there any way (in c/c++) to find out how many current connections 
there are to a database that i am connected to?


i'd like to do some housekeeping on the database every so often, but 
only if there's no one else connected to it at the time.


any ideas?

thanks.

- chase




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



[sqlite] SQLite extension

2007-08-11 Thread Cesar D. Rodas
Hello SQLite community

I am doing an investigation about Text Categorization based on
N-Grams at my University. The main goal of the project is to offer a
inexpensive way to categorize texts based on previous "learn". The
categorization could not only be done as the language of the text, my
hypothesis is that I could work well for categorize by subject of a
text. The project is a "alpha" based and is writing in PHP for many
reasons, I think the most important is that easier to write and debug
than C.

The previous paragraph was only an introduction of what I want
to propose to the SQLite community, that was *not* advertisement or
spam.

I think that SQLite is a good database, and very useful for
many task. I think the simple and effective architecture of SQLite
made it popular and useful for developers. For that reasons I was
thinking to write an extension for SQLite adding a Text Categorization
module to it. You may be wondering *why* or how that can be useful for
you?.

I think I have the answer. Because n-gram based text
categorization works well for *long texts* and it is human-language
independent, that offer us (developers) a way to give to SQLite the
"knowledge" and "power" to categorize text automatically, of course
with a previous trine for every possible category with a set of
examples. This is useful for build a system for categorize articles of
a news-paper or organize a library.

My experiments are not finish, but first of nothing I want to
know if is this a good idea and of course, if it useful for SQLite
community.

-- 
Cesar D. 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] sqlite3 datatype

2007-08-11 Thread Gerry Snyder

fred238 wrote:

Gerry Snyder a écrit :

fred238 wrote:

hello,

Is necessary to set column datatype in sqlite3 ?
Is better to use class storage in sqlite3 (TEXT, NUMERIC, INTEGER, 
REAL, NONE)  ?



Check out http://www.sqlite.org/datatype3.html and ask again here if 
yu have further questions.



Gerry

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






already read it and i don't understand all



Ok, I will try to help a little.

You do not need to set data types. If you don't, the default affinity 
will be NUMERIC. That is, anything that looks like a number will be 
stored as an integer or a real, as appropriate. This can waste some time 
if you want to use the value as a string, but in general should not be a 
real problem.


Specifying datatypes may make things easier for some strongly typed 
languages (I don't really know--I use Tcl myself).


But I think the only short answer to your "Is it better...?" question 
is, "It depends."


Gerry



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



Re: [sqlite] sqlite3 datatype

2007-08-11 Thread fred238

Gerry Snyder a écrit :

fred238 wrote:

hello,

Is necessary to set column datatype in sqlite3 ?
Is better to use class storage in sqlite3 (TEXT, NUMERIC, INTEGER, 
REAL, NONE)  ?



Check out http://www.sqlite.org/datatype3.html and ask again here if yu 
have further questions.



Gerry

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






already read it and i don't understand all


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



Re: [sqlite] sqlite3 datatype

2007-08-11 Thread Gerry Snyder

fred238 wrote:

hello,

Is necessary to set column datatype in sqlite3 ?
Is better to use class storage in sqlite3 (TEXT, NUMERIC, INTEGER, 
REAL, NONE)  ?



Check out http://www.sqlite.org/datatype3.html and ask again here if yu 
have further questions.



Gerry

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



[sqlite] sqlite3 datatype

2007-08-11 Thread fred238

hello,

Is necessary to set column datatype in sqlite3 ?
Is better to use class storage in sqlite3 (TEXT, NUMERIC, INTEGER, REAL, NONE)  
?

regards,

fred.


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



Re: [sqlite] SQLITE_CORRUPT: database disk image is malformed

2007-08-11 Thread Joe Wilson
If you recompile sqlite3 with -DSQLITE_DEBUG=1, run sqlite3 in a 
debugger, and set a breakpoint on sqlite3Corrupt you can get
a stack trace showing what led up to SQLITE_CORRUPT.  
But although this will show you roughly where the file is corrupt, 
it probably won't help you with why.

If your OS is repeatably ceasing while running your app, you've 
probably got a hardware problem. Windows or not, this shouldn't happen.

--- Andrew Finkenstadt <[EMAIL PROTECTED]> wrote:
> Is there a good way/tool to determine what went wrong in a database file
> reporting SQLITE_CORRUPT?
> 
> The details I have so far are:  machine (running Windows XP) locked up hard
> while executing our application.  Repeatable hard-lock at a certain point.
> (Hard lock is defined as no mouse, no keyboard, no display update,
> necessitating reset button or power cycle.)
> 
> I've noticed that disk drivers will lie about whether data has been truly
> committed to physical media in the interests of passing a benchmark faster.
> I suspect something is going on here.



   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail=summer+activities+for+kids=bz
 

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



Re: [sqlite] ~/sqliterc example/documentation avaible?

2007-08-11 Thread Joe Wilson
--- Trevor Talbot <[EMAIL PROTECTED]> wrote:
> On 8/11/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
> 
> > You can put any command seen in ".help" in the sqlite3 shell
> > or any SQL command in ~/.sqliterc, such as:
> 
> ...and of course, I would completely forget about the shell.  Oops.

As always, the definitive document is the source code itself:

http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/shell.c=1.166



   

Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
http://farechase.yahoo.com/

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



Re: [sqlite] Help with performance...

2007-08-11 Thread Joe Wilson
Not much you can do.
You could examine the output of EXPLAIN QUERY PLAN for those statements.

Hard to know without knowing the schema, but try making the "id" an 
INTEGER PRIMARY KEY, assuming it's appropriate for your data.

Try to have as few indexes as possible on the table being inserted into.

--- Ken <[EMAIL PROTECTED]> wrote:
> I'm looking for your help solving a performance issue:
> 
> Master db and an attached db. called A
> 
> Table x and table Y are identical in both the master and Attached database.
> table Z is built to determine the set of rows to copy and has an index on the 
> id field.
> 
> The goal is to move data from many attached db's to the master.
> 
> SQL statements:
> Begin;
>insert into x 
> select  x1.* from a.x x1 , Y
>where x1.id = y.id ;
> commit;
> takes 4.08 seconds to move 3904 rows.
> 
> begin;
>insert into y 
>  select  y1.* from a.x y1 , Y
> where y1.id = y.id ;
>  commit;
>   Takes 2.19 seconds to move 2676 rows.
> 
> So X is moved at 922 r/s  and y is moved at 1221 r/s.
> Table X has  16 columns and no blobs
> Table Y has 22 columns one of which is a blob.
> 
> All columns are integers except for the blob on table y.
> 
> So why is the X copy performance 25% slower than Y ?
> 
> Page size is 4k.
> Cache size is 4000.
> locking_mode = exclusive.
> Synchronous off
> 
> Is there any way to disable journaling? 
> I can always re-create the DB should anything fail. 
> 
> Any other ideas on how to make this run quicker?
> 
> Thanks,
> Ken



   

Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

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



Re: [sqlite] ~/sqliterc example/documentation avaible?

2007-08-11 Thread Trevor Talbot
On 8/11/07, Joe Wilson <[EMAIL PROTECTED]> wrote:

> You can put any command seen in ".help" in the sqlite3 shell
> or any SQL command in ~/.sqliterc, such as:

...and of course, I would completely forget about the shell.  Oops.

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



Re: [sqlite] ~/sqliterc example/documentation avaible?

2007-08-11 Thread Joe Wilson
--- Brickl Roland <[EMAIL PROTECTED]> wrote:
> where can i find information about how the config-file should look like and 
> what is possible?

You can put any command seen in ".help" in the sqlite3 shell 
or any SQL command in ~/.sqliterc, such as:

select 'no place like home';
.mode column
.header on

You can specify an alternative config file with -init.
  
  sqlite3 -init /whatever/sqliterc your.db


   

Be a better Globetrotter. Get better travel answers from someone who knows. 
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list=396545469

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



Re: [sqlite] sqlite3_open function

2007-08-11 Thread John Stanton

Perform an "access" or equivalent instruction before calling sqlite3_open.

fred238 wrote:

hello,

Is there a way to not create a database while the db file is not found 
with the sqlite3_open function ?


Why don't just create a create_table function instead of ?

regards,

fred.


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






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



Re: [sqlite] Threading issues in SQLite

2007-08-11 Thread Jiri Hajek
After several experiments and tests, I ended up using one SQLite
connection in several threads. This certainly doesn't currently work
in SQLite natively, but if you properly use some locking mechanism
(CriticalSections in my case), it works fine.

Jiri

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