Re: [sqlite] Integer / Numeric calculations

2006-05-22 Thread John Stanton
Make your column an underlying Sqlite data type, REAL, which is an 8 byte floating point number. Sqlite performs "manifest typing" which means that if you store an integer such as 27 in your NUMERIC field it will be stored as an INTEGER and if you store a real such as 27.75 it will be stored

[sqlite] Re: Encoding problem ISO 8859-1 / UTF-8

2006-05-22 Thread Hussain KH
Dear All The same thing happened to me also when I'm working with Malayalam (Indic) script. I'm working in Windows XP, Sqlite3, SqliteOdbc by Werner and Delphi with Unicode compliant TNT controls. I have created some records in MS Access using Malaylam script. I have exported these records to a

[sqlite] For Mike

2006-05-22 Thread John Stanton
"Make your column an underlying Sqlite data type, REAL, which is an 8 byte floating point number". I just realized that this is not true. Ignore it

RE: [sqlite] Pragmas

2006-05-22 Thread Anish Enos Mathew
Hi, I used the following command for setting the page size. PRAGMA page_size = 4096; before the table is created. But it is showing an error, "PRAGMA undeclared". What could be the problem? Do I need to include any header file for it? -Original Message- From: Nemanja Corlija

RE: [sqlite] Pragmas

2006-05-22 Thread Manzoor Ilahi Tamimy
Dear Anish I am using the same --- sqlite3_open(database, ); sqlite3_exec(db, "PRAGMA page_size=4096", NULL, NULL, NULL); sqlite3_exec(db, "create table t...

Re: [sqlite] Integer / Numeric calculations

2006-05-22 Thread Mikey C
Thanks for taking the time John, It does not seem to matter what the underlying column type is defined at, SELECT 42 / 9 will always return an integer division. I fool SQLite by always adding 0.00 to my numbers incase they happen to be integer values in that row, SELECT (col1 + 0.00) / (col2 +

Re: [sqlite] Integer / Numeric calculations

2006-05-22 Thread A. Pagaltzis
* Mikey C <[EMAIL PROTECTED]> [2006-05-22 08:00]: > If have tried cast both rating and votes and the result to NUMERIC but still > an integer. Cast one of them to REAL. SELECT CAST( rating AS REAL ) / votes FROM foo; Regards, -- Aristotle Pagaltzis //

Re: [sqlite] Integer / Numeric calculations

2006-05-22 Thread John Stanton
I gave you wrong information ro start about REAL, wasn't thinking. I look at the column type and if it returns an integer transform it to a float. Mikey C wrote: Thanks for taking the time John, It does not seem to matter what the underlying column type is defined at, SELECT 42 / 9 will

[sqlite] SELECT count...

2006-05-22 Thread Danilo
Hi to all, I am looking for the way of memorizing the result of: SELECT count(field1) FROM Table1 WHERE field1 LIKE 'xyz%'; in a int variable, without a callback or sqlite3_prepare-SQLITE_SCHEMA in C++ program. Is there a way to do it? Regards, Danilo. Home Page: http://www.digitazero.org

RE: [sqlite] High retrieval time. Please help

2006-05-22 Thread Anish Enos Mathew
Hi Michael, I came to know that increasing the page size would help in better performance. So I used PRAGMA and set the page size to 32768 using the command, sqlite3_exec (db, "PRAGMA page_size = 32768", NULL, NULL, NULL); Still result is the same. Taking a time of 110 sec

Re: [sqlite] Can't access sqlite_master from VB6 via ODBC

2006-05-22 Thread [EMAIL PROTECTED]
Hi I thought it wasn't permissions. The VB interface I'm using is ActiveX Data Objects, which works through ODBC and the SQLite ODBC driver. Might there be some problem with this driver? Robin Original Message: - From: John Stanton [EMAIL PROTECTED] Date: Mon, 22 May 2006

Re: [sqlite] Can't access sqlite_master from VB6 via ODBC

2006-05-22 Thread [EMAIL PROTECTED]
Hi Yes I did look at that, but I was wanting to use ODBC to access SQLite as that is what I and my students are used to. In VB you can use the same programming commands (ADO) to access any ODBC database. My students are used to this and I'd like to carry on using this if possible. I will,

[sqlite] sqlite schema error

2006-05-22 Thread Shields, Daniel
I apologise in advance as this topic has been done to death. Can I assume that a schema error can only occur when calling sqlite3_step? I've trawled through the documentation but cant find a definitive answer. Thanks, Daniel. -- Daniel Shields Equities IT +44(0)207 888 9248 [EMAIL

[sqlite] Help creatign a database using Finisar SQLite ADO.Net provider and VB.Net

2006-05-22 Thread John Newby
Hi, I am trying to open a database, using the input database name given by the user, if I run the testDB() function where the source of the database is given, it works fine, but if I try to use the createNewdatabase() function, passing back the string with the filename from the input and it

Re: [sqlite] Can't access sqlite_master from VB6 via ODBC

2006-05-22 Thread Nemanja Corlija
On 5/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I was playing with the problem a bit more last night, and found that some queries worked (for example the one specified on your example page: SELECT name FROM sqlite_master WHERE type='table' UNION ALL SELECT name FROM sqlite_temp_master

[sqlite] How to check whether sqlite_open created the new database ?

2006-05-22 Thread kamil
I have to create a database schema in such case. Thanks in advance, Kamil

Re: [sqlite] create unique index quickly

2006-05-22 Thread drh
"Brannon King" <[EMAIL PROTECTED]> wrote: > The statement > CREATE UNIQUE INDEX primkey ON 4dData (x,y,z) > is too slow for me. > > Is there some way I can create that unique index without the overhead of > uniqueness checking? I know all my triples are unique when used = > together: I >

Re: [sqlite] Re: How to check whether sqlite_open created the new database ?

2006-05-22 Thread Thomas Chust
On Mon, 22 May 2006, Igor Tandetnik wrote: kamil <[EMAIL PROTECTED]> wrote: How to check whether sqlite_open created the new database ? I have to create a database schema in such case. sqlite_master table would be empty in a freshly created database. [...] Hello, checking the

Re: [sqlite] Can't access sqlite_master from VB6 via ODBC

2006-05-22 Thread drh
Robin Wilson <[EMAIL PROTECTED]> wrote: > > I have had a few problems though. At the moment I am accessing SQLite > through ODBC from Visual Basic 6. This means the students can carry on > using the ADO commands that they are familier with (from working with > Access DBs). However, when

Re: [sqlite] Can't access sqlite_master from VB6 via ODBC

2006-05-22 Thread [EMAIL PROTECTED]
Hi That is what I thought. Who should I report the bug to? Cheers, Robin Original Message: - From: [EMAIL PROTECTED] Date: Mon, 22 May 2006 08:14:12 -0400 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Can't access sqlite_master from VB6 via ODBC Robin Wilson <[EMAIL

[sqlite] ACID for attached databases

2006-05-22 Thread Martin Pfeifle
Dear all, We plan to update several sqlite database files within one transaction. I was just reading the following on the SQLite homepage: "Transactions involving multiple attached databases are atomic, assuming that the main database is not ":memory:". We do not have memory databases. But I

Re: [sqlite] create unique index quickly

2006-05-22 Thread Dennis Jenkins
Brannon King wrote: > The benefits I'm trying to get out of sqlite are the data queries. I > collect a large, sparse 2D array from hardware. The hardware device is > giving me a few GB of data data at 200MB/s. Future hardware versions > will be four times that fast and give me terabytes of data.

[sqlite] Re: ACID for attached databases

2006-05-22 Thread Igor Tandetnik
Martin Pfeifle <[EMAIL PROTECTED]> wrote: We do not have memory databases. But I do not understand how atomicity is achieved. I understand that the ACID principle can be realized by means of the fsync command. But how does this work for more than one database file? Can anyone explain that to me,

AW: [sqlite] Re: ACID for attached databases

2006-05-22 Thread Martin Pfeifle
thank you, that is exactly what I searched for. Best Martin - Ursprüngliche Mail Von: Igor Tandetnik <[EMAIL PROTECTED]> An: SQLite Gesendet: Montag, den 22. Mai 2006, 15:03:03 Uhr Betreff: [sqlite] Re: ACID for attached databases Martin Pfeifle <[EMAIL

Re: [sqlite] create unique index quickly

2006-05-22 Thread Jay Sprenkle
On 5/22/06, Dennis Jenkins <[EMAIL PROTECTED]> wrote: Brannon King wrote: > The benefits I'm trying to get out of sqlite are the data queries. I > collect a large, sparse 2D array from hardware. The hardware device is > giving me a few GB of data data at 200MB/s. Future hardware versions > will

Re: [sqlite] High retrieval time. Please help

2006-05-22 Thread Michael Sizaki
Hi Anish, when a database hits the disk, there's not much you can do about. You can increase the memory of your system, so that the entire database fits into memory. If the database is "cold" (the system has started and the database is not in the file system cache), you can read the entire

Re: [sqlite] create unique index quickly

2006-05-22 Thread Dennis Jenkins
Jay Sprenkle wrote: > > Me too! > > The two largest database setups I've worked with: > the total of all the call records for a major phone company, > and the cumulative records of most of the drugs bought in > the United States, don't add up to as much as this. > What are you sampling at 1/200th

Re: [sqlite] SELECT count...

2006-05-22 Thread Jay Sprenkle
On 5/22/06, Danilo <[EMAIL PROTECTED]> wrote: Hi to all, I am looking for the way of memorizing the result of: SELECT count(field1) FROM Table1 WHERE field1 LIKE 'xyz%'; in a int variable, without a callback or sqlite3_prepare-SQLITE_SCHEMA in C++ program. Is there a way to do it? look at

Re: [sqlite] I need help understanding fake columns

2006-05-22 Thread Jay Sprenkle
On 5/21/06, Brannon King <[EMAIL PROTECTED]> wrote: Jay Sprenkle wrote: >> score(x,y) = max(score(x+n,y+n)-n*penalty) where n < drc(x+n,y+n) < 256 > > So at some 'sample' you have the score and drc, but not the x,y value? > The x,y values can be interpolated using some algebra and the

Re: [sqlite] create unique index quickly

2006-05-22 Thread Micha Bieber
Monday, May 22, 2006, 15:17:21, Jay Sprenkle wrote: > On 5/22/06, Dennis Jenkins <[EMAIL PROTECTED]> wrote: >> Brannon King wrote: >> > The benefits I'm trying to get out of sqlite are the data queries. I >> > collect a large, sparse 2D array from hardware. The hardware device is >> > giving me a

Re: [sqlite] create unique index quickly

2006-05-22 Thread Jay Sprenkle
On 5/22/06, Dennis Jenkins <[EMAIL PROTECTED]> wrote: Jay Sprenkle wrote: > > Me too! > > The two largest database setups I've worked with: > the total of all the call records for a major phone company, > and the cumulative records of most of the drugs bought in > the United States, don't add up

RE: [sqlite] create unique index quickly

2006-05-22 Thread Brannon King
> _Personally_ I think, this sounds like a task not quite > fitting in sqlites (probably any 'standard' databases) realm. > This is a bit off-topic in this group, but because you > mention sub-boxes - did you ever look into more specialized > file-formats like HDF5: > >

RE: [sqlite] I need help understanding fake columns

2006-05-22 Thread Brannon King
> If I understand it right you'll definitely need a correlated subquery. > You need one query to calculate the max() of the 257(0-256?) values. > There must be some way to define which values should be used > in that calculation for a specific piece (the distance). Is > the distance geometric

Re: [sqlite] create unique index quickly

2006-05-22 Thread Jay Sprenkle
On 5/22/06, Brannon King <[EMAIL PROTECTED]> wrote: > _Personally_ I think, this sounds like a task not quite > fitting in sqlites (probably any 'standard' databases) realm. > This is a bit off-topic in this group, but because you > mention sub-boxes - did you ever look into more specialized >

RE: [sqlite] create unique index quickly

2006-05-22 Thread Brannon King
> I am simply curious. This sounds like an amazing > engineering challenge. If it is not a secret, can you > describe what this data represents and how it will be used? Genomics. Look up "Smith-Waterman" or "Needleman-Wunsch-Sellers" on the web. > What is the ultimate source of this

[sqlite] Crashing aplication...

2006-05-22 Thread Esteban Zeller
Any one any idea? My app get this backtrace when i execute it: #0 0xb6f0f3ee in __waitpid_nocancel () from /lib/tls/libpthread.so.0 #1 0xb7b03500 in KCrash::defaultCrashHandler () from /opt/kde/lib/libkdecore.so.4 #2 #3 0xb7f0a246 in sqlite3SafetyOn () from /usr/lib/./libsqlite3.so.0 #4

RE: [sqlite] create unique index quickly

2006-05-22 Thread Brannon King
Thank you for answering the question! Like I said in my other post, the index creation is about 20% faster than the unique index creation in my latest tests of an index of two INTEGERs. 20% out of several hours is significant. So index names are unique for the whole database? I was thinking they

Re: [sqlite] I need help understanding fake columns

2006-05-22 Thread Jay Sprenkle
On 5/22/06, Brannon King <[EMAIL PROTECTED]> wrote: > If I understand it right you'll definitely need a correlated subquery. > You need one query to calculate the max() of the 257(0-256?) values. > There must be some way to define which values should be used > in that calculation for a specific

Re: [sqlite] Advice on compiling 3.5.5 for Mac OS X?

2006-05-22 Thread Bill Bumgarner
On May 21, 2006, at 5:05 PM, Kon Lovett wrote: I second this. I am not even sure /usr/lib/libreadline.dylib is readline. It is a symbolic link to libedit.dylib for me. So I use my own build of readline as well. It is the BSD version of readline which lacks the history API and a couple of

[sqlite] sqlite3_exec returning SQLITE_CANTOPEN

2006-05-22 Thread Pat Wibbeler
I'm periodically seeing sqlite3_exec return SQLITE_CANTOPEN. Unfortunately, I haven't boiled this down to a simple sample that I can send to this list, but I thought I'd check to see if there is a known solution before I dive too deep. I'm using sqlite version 3.2.7 on windows. Thanks! Pat The

Re: [sqlite] scary warnings

2006-05-22 Thread Roger Binns
This is pretty much a bogus warning since in windows size_t is an integer: size_t should always be unsigned. ssize_t is the signed variant. Roger

Re: [sqlite] create unique index quickly

2006-05-22 Thread Jay Sprenkle
On 5/22/06, Micha Bieber <[EMAIL PROTECTED]> wrote: > Interesting, but it doesn't have any adhoc query capability: Take in consideration, that this is not the whole truth - simply selecting and getting what the HDF5 authors call a 'hyperslab' is a great feature and an example for a simple query

Re: [sqlite] Make it faster

2006-05-22 Thread Anne . Kirchhellen
Hi John > Anne, you don't say that you make your 100 inserts a transaction. Yes, I don't make the inserts in a transaction... because in that moment don't know how to use it. Now I have read in the Docu and after it seems to me, that I understand, I insert a Test-Function in my App. I start

Re: [sqlite] scary warnings

2006-05-22 Thread Cory Nelson
On 5/22/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: On 5/22/06, Brannon King <[EMAIL PROTECTED]> wrote: > Is the number of size conversion warnings during sqlite compile > disconcerting to anyone but myself? I've attached a log of them below. I > vdbemem.c > vdbemem.c(194) : warning C4267: '='

[sqlite] reset function speed

2006-05-22 Thread Brannon King
I noticed some interesting things about the step function. I have a query with a MAX in it; hence, it always returns one row. (Well, it returns one row every time I use the step function and when I use the sqlite3.exe browser, but the sqlite3_exec function does not run the callback in the case

[sqlite] can you speed this query up?

2006-05-22 Thread Brannon King
It seems that I yet need help with another query. This one is just too slow. I've included the "explain" and the table schema. I've been using the prepare/step model directly. What should I change on my indexing to make it faster? The schema: CREATE TEMPORARY TABLE IF NOT EXISTS bounds (bi

Re: [sqlite] scary warnings

2006-05-22 Thread Nuno Lucas
On 5/22/06, Cory Nelson <[EMAIL PROTECTED]> wrote: The warning is likely because size_t can be 64bit and "int" is always 32bit. Either way, it should be casted. Not really, size_t can be 64 or any other size in bits and same with int's. If I'm not mistaken, size_t is 64 bits on Microsoft 64

Re: [sqlite] can you speed this query up?

2006-05-22 Thread Brannon King
select qi, ri, drl, max(score), min(score) from ... What values of qi, ri, and drl would you want this query to return? What you have to do is: SELECT qi, ri, drl, score FROM ... WHERE score=(SELECT max(score) FROM ...) Thank you for the instruction, although the other query

Re: [sqlite] can you speed this query up?

2006-05-22 Thread A. Pagaltzis
Hi Brannon, * Brannon King <[EMAIL PROTECTED]> [2006-05-23 05:35]: * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2006-05-23 02:35]: > >select qi, ri, drl, max(score), min(score) from ... > > > >What values of qi, ri, and drl would you want > >this query to return? > > > >What you have to do is: > > >

Re: [sqlite] scary warnings

2006-05-22 Thread Cory Nelson
On 5/22/06, Nuno Lucas <[EMAIL PROTECTED]> wrote: On 5/22/06, Cory Nelson <[EMAIL PROTECTED]> wrote: > The warning is likely because size_t can be 64bit and "int" is always > 32bit. Either way, it should be casted. Not really, size_t can be 64 or any other size in bits and same with int's.