Re: [sqlite] sqlite-3.3.4 and extra float decimals

2006-04-05 Thread Floppe
Will Leshner wrote: > On 4/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> When using sqlite-3.3.4 with windows I get the following strange behaviour. >> >> create table Muppet (Kermit float); >> insert into Muppet values (100); >> select * from Muppet; >> 100.0 >> > >

Re: [sqlite] Update A table

2006-04-05 Thread Jim Dodgen
the way I do it is: update table1 set table1.f1 = (select table2.f1 from table2 WHERE table1.f0 = table2.f0) where exists (select * from table2 WHERE table1.f0 = table2.f0); Francisco Tapia wrote: I want to update data from table1 to table2, i seems I cannot get this to work right,

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread Dennis Cote
m christensen wrote: [EMAIL PROTECTED] wrote: m christensen <[EMAIL PROTECTED]> wrote: Ok, more info The SQLite.so library in the perl site install directory is version 3.2.7 from looking at the strings in the binary itself. If I rename that file so as to 'hide' it the perl code fa

Re: [sqlite] Update A table

2006-04-05 Thread Francisco Tapia
very cool. thanks. On 4/5/06, Dennis Cote <[EMAIL PROTECTED]> wrote: > Francisco, > > You might want to add a coalesce() call so the f1 value is only changed > if there is a corresponding value in table2. > > update table1 > set f1 = coalesce((select f1 from table2 where table2.f0 = table1.f0), f

Re: [sqlite] Update A table

2006-04-05 Thread Francisco Tapia
Dennis, That seems to be the correct syntax... very cool.. many thanks!!! --Francisco On 4/5/06, Dennis Cote <[EMAIL PROTECTED]> wrote: > Francisco Tapia wrote: > > >I want to update data from table1 to table2, i seems I cannot get this > >to work right, perhaps my syntax is wrong? > > > > > >

Re: [sqlite] Update A table

2006-04-05 Thread Dennis Cote
Francisco, You might want to add a coalesce() call so the f1 value is only changed if there is a corresponding value in table2. update table1 set f1 = coalesce((select f1 from table2 where table2.f0 = table1.f0), f1) Dennis Cote

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread m christensen
[EMAIL PROTECTED] wrote: m christensen <[EMAIL PROTECTED]> wrote: Ok, more info The SQLite.so library in the perl site install directory is version 3.2.7 from looking at the strings in the binary itself. If I rename that file so as to 'hide' it the perl code falls over dead as it ca

Re: [sqlite] Update A table

2006-04-05 Thread Dennis Cote
Francisco Tapia wrote: I want to update data from table1 to table2, i seems I cannot get this to work right, perhaps my syntax is wrong? update table1 set table1.f1 = table2.f1 FROM table1, table2 WHERE table1.f0 = table2.f0 -- -Francisco http://pcthis.blogspot.com |PC news with out the jarg

[sqlite] Update A table

2006-04-05 Thread Francisco Tapia
I want to update data from table1 to table2, i seems I cannot get this to work right, perhaps my syntax is wrong? update table1 set table1.f1 = table2.f1 FROM table1, table2 WHERE table1.f0 = table2.f0 -- -Francisco http://pcthis.blogspot.com |PC news with out the jargon! http://sqlthis.blogspo

Re: AW: [sqlite] primary key and physical data organization

2006-04-05 Thread Dennis Cote
Martin Pfeifle wrote: Thanks, If we look at a B+-tree, all records are stored at the leaf level and form at least a logical list. But what happens, if we insert new records which do not fit on the corresponding leaf page any more. Assume this page has to be split. Where is the newly created p

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread drh
m christensen <[EMAIL PROTECTED]> wrote: > Ok, more info > > The SQLite.so library in the perl site install directory is version > 3.2.7 from looking at the strings in the binary itself. > > If I rename that file so as to 'hide' it the perl code falls over dead > as it can't find it. > > SO

Re: AW: [sqlite] primary key and physical data organization

2006-04-05 Thread drh
Martin Pfeifle <[EMAIL PROTECTED]> wrote: > Our goal is that all records are physically clustered according to their RO= > WID. > In order to achieve this goal, does it make sense to reorganize a table by = > for instance a command like > "insert into reorganized_table > select * from original_tabl

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread m christensen
Ok, more info The SQLite.so library in the perl site install directory is version 3.2.7 from looking at the strings in the binary itself. If I rename that file so as to 'hide' it the perl code falls over dead as it can't find it. SO I have a library that I NOW it is using which: Clai

AW: [sqlite] primary key and physical data organization

2006-04-05 Thread Martin Pfeifle
Thanks, If we look at a B+-tree, all records are stored at the leaf level and form at least a logical list. But what happens, if we insert new records which do not fit on the corresponding leaf page any more. Assume this page has to be split. Where is the newly created physical page stored? Does

Re: [sqlite] primary key and physical data organization

2006-04-05 Thread Dennis Cote
Martin Pfeifle wrote: Hi, Assume I have a table containing an integer primary key. As far as I know, this value is identical to the ROWID, right? How does SQLite organize the data within the file? Does it try to organize the data on the pages according to the primary key (=ROWID) or according

AW: [sqlite] primary key and physical data organization

2006-04-05 Thread Martin Pfeifle
That's great thank you very much. - Ursprüngliche Mail Von: [EMAIL PROTECTED] An: sqlite-users@sqlite.org; Martin Pfeifle <[EMAIL PROTECTED]> Gesendet: Mittwoch, den 5. April 2006, 23:09:25 Uhr Betreff: Re: [sqlite] primary key and physical data organization Martin Pfeifle <[EMAIL PROTE

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread m christensen
OK, the DBD 1.11 install creates a SQLite.so Library. There is ONE in the perl site install directory. The is another one burried down in /home which perl SHOULD not find The strings command finds version 3.2.7 in BOTH files. Where else could perl possibly be finding a SQLite library?

Re: [sqlite] primary key and physical data organization

2006-04-05 Thread drh
Martin Pfeifle <[EMAIL PROTECTED]> wrote: > Hi, > Assume I have a table containing an integer primary key. As far as I know, > this value is identical to the ROWID, right? Correct > How does SQLite organize the data within the file? > Does it try to organize the data on the pages according to th

[sqlite] primary key and physical data organization

2006-04-05 Thread Martin Pfeifle
Hi, Assume I have a table containing an integer primary key. As far as I know, this value is identical to the ROWID, right? How does SQLite organize the data within the file? Does it try to organize the data on the pages according to the primary key (=ROWID) or according to the insertion order of

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread m christensen
My Perl code reports version 3.2.2 from $dbh->{sqlite_version} My sqlite header file in the sqlite DBD 1.11 install dir clearly states 'IT' is 3.2.7. The DBD 1.11 install built fine, tested perfectly and installed without errors. There must be an older one that came with the OS install or s

Re: [sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread Dennis Cote
m christensen wrote: I have a linux machine that saw one-to-many power outages. I got a backup of everything and reinstalled it. I have some code that uses Perl DBI and connects to several Oracle Databases and builds several local sqlite databases. It pulls a lot of data from Oracle and bui

Re: [sqlite] sql question

2006-04-05 Thread Dennis Cote
Uma Venkataraman wrote: I want to recycle the table for which I need to be able to delete the first 100 records from a table and add 100 new records. Thanks Uma, See my reply to a similar question about FIFO tables in the archives at http://article.gmane.org/gmane.comp.db.sqlite.general/1

Re: [sqlite] Syntax error near "NOT"

2006-04-05 Thread Pam Greene
What version are you using? The "IF NOT EXISTS" clause only exists in SQLite 3.3.0 and later. - Pam On 4/5/06, Lucky Luke <[EMAIL PROTECTED]> wrote: > > Ok, a VERY VERY strange error, which I can't solve. > > I use the SQLite.NET wrapper from www.phpguru.org to use it with C#. > > I have the foll

[sqlite] Sudden DISTINCT parsing failures with perl and sqlite DBD 1.11 / DBI 1.5 / sqlite 3.2.7 /CentOS 4.3 -or- RHEL 4 linux.

2006-04-05 Thread m christensen
I have a linux machine that saw one-to-many power outages. I got a backup of everything and reinstalled it. I have some code that uses Perl DBI and connects to several Oracle Databases and builds several local sqlite databases. It pulls a lot of data from Oracle and builds several hundred Meg

[sqlite] Syntax error near "NOT"

2006-04-05 Thread Lucky Luke
Ok, a VERY VERY strange error, which I can't solve. I use the SQLite.NET wrapper from www.phpguru.org to use it with C#. I have the following query: sql = "CREATE TABLE IF NOT EXISTS bot_users (" + "username VARCHAR(100)," + "password VARCHAR(100) " +

Re: [sqlite] Windows problem when updating

2006-04-05 Thread Milton Sagen
I'd assume that something like that is exactly what's happening since the problem only happens after a reboot, although I was thinking that sqlite was caching it to a temp file or something. I'm running Windows XP Pro but I haven't done anything to change the default behavior of the os. O

[sqlite] sql question

2006-04-05 Thread Uma Venkataraman
I want to recycle the table for which I need to be able to delete the first 100 records from a table and add 100 new records. Thanks

Re: [sqlite] Speed, Locks and Stability

2006-04-05 Thread Clay Dowling
Deepak Kaul said: > 1. Calling sqlite_exec within my C++ program Good for one-off statements, like DDL. If you have to generate the SQL and deal with parameters though, this option is no good. > 2. Calling sqlite_prepare, sqlite3_step and sqlite3_finalize within my > C++ program Best for mu

Re: [sqlite] sqlite-3.3.4 and extra float decimals

2006-04-05 Thread Will Leshner
On 4/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > When using sqlite-3.3.4 with windows I get the following strange behaviour. > > create table Muppet (Kermit float); > insert into Muppet values (100); > select * from Muppet; > 100.0 That's not strange. Kermit is defined to be a

Re: [sqlite] Question on how to enter blobs in sqlite3

2006-04-05 Thread Roman
Thank you for the reply Thomas, I found that an extra space would not let me set the field to a value. I went over your code, and I managed to get the script working for me. I am looking through ther bind functions to see the benefit. Thanks again, My sqlite3 is working good now, since I know mo

Re: [sqlite] Speed, Locks and Stability

2006-04-05 Thread John Stanton
If your application runs the same SQL statements more than once, use prepare, but this way sqlite3_prepare ... multiple sqlite3_step sqlite3_reset at the end sqlite3_finalize Sqlite3_exec is just a wrapper around prepare, step, reset...

Re: [sqlite] UI framework for sqlite

2006-04-05 Thread Micha Bieber
Frankly, I'm a bit surprised that you seemingly never were in contact with one of the many popular widget libraries, offering the mentioned (btw similar) solutions to your problem. Some of the libraries also have more unified interfaces to different backends (also sqlite). To add another one, I'm u

Re: [sqlite] Speed, Locks and Stability

2006-04-05 Thread Dennis Cote
Deepak Kaul wrote: Please rank the following scenarios considering speed, locks and stability. I'm using sqlite in a C++ environment and running in a single process and single threaded environment where SQL_BUSY should occur minimally. 1. Calling sqlite_exec within my C++ program 2. Calli

[sqlite] Speed, Locks and Stability

2006-04-05 Thread Deepak Kaul
Please rank the following scenarios considering speed, locks and stability. I'm using sqlite in a C++ environment and running in a single process and single threaded environment where SQL_BUSY should occur minimally. 1. Calling sqlite_exec within my C++ program 2. Calling sqlite_prepare, sq

Re: [sqlite] Strange Behaviour on Solaris 8 on Sparc

2006-04-05 Thread Martin Jenkins
Are those directories on the same disk/partition? What do the results look like if you replace "| sqlite" with "> /dev/null"? I'm not 100% sure that you're timing the sqlite part here. I think you're timing the cat, hence my earlier comments. Try "time sqlite < /export/home/ykphuah/test.sql" (un

RE: [sqlite] UI framework for sqlite

2006-04-05 Thread Fred Williams
Not sure why you are trying to do something like that. One technique which seems to be quite common, and that I use extensively, is to present a scrollable read only grid of pertinent data fields. with a "VCR" button set for control. The user can press the buttons for Insert, Delete, or Edit for

Re: [sqlite] UI framework for sqlite

2006-04-05 Thread Ulrich Schöbel
Hi David, if you're looking for a truly portable tool, you should consider Tcl/Tk. SQLite has a builtin interface to Tcl, Starkits are portable between many OSes without any code change and the tktable widget ot tablelist should be what you are looking for to present your data. Visit http://wiki.

Re: [sqlite] UI framework for sqlite

2006-04-05 Thread Jay Sprenkle
On 4/5/06, David Bicking <[EMAIL PROTECTED]> wrote: > > So I am looking for links to tutorials or how-tos, or even the right > string of text to use on google to point me in the right direction. You might look into these: Java is very much like C++ The Eclipse IDE is supposed to be very good. ht

Re: [sqlite] UI framework for sqlite

2006-04-05 Thread Olaf Beckman Lapré
There's the SQLite Control Center: http://bobmanc.home.comcast.net/sqlitecc.html Olaf - Original Message - From: "David Bicking" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 05, 2006 3:42 PM Subject: [sqlite] UI framework for sqlite > This is probably off-topic for this list, so le

Re: [sqlite] UI framework for sqlite

2006-04-05 Thread drh
David Bicking <[EMAIL PROTECTED]> wrote: > > I am looking for links to tutorials or how-tos,... > to point me in the right direction. > http://wiki.tcl.tk/15631 -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] UI framework for sqlite

2006-04-05 Thread Clay Dowling
David, What you're looking for is an editable data grid. They're common components and fairly easy to find. They're also typically a pain in the tail. If you're comfortable with C++ you might look at wxWidgets and their built-in datagrid. Clay David Bicking said: > This is probably off-topic

[sqlite] UI framework for sqlite

2006-04-05 Thread David Bicking
This is probably off-topic for this list, so let me apologize in advance if it is. I don't have a probably in using sqlite itslef, but in rather how to use a UI to present the info to the user. I am not neccesarily asking for how to advice here, but rather pointers on where I can find such advice.

Re: [sqlite] Windows problem when updating

2006-04-05 Thread Jay Sprenkle
On 4/4/06, Milton Sagen <[EMAIL PROTECTED]> wrote: > After a machine restart the first time I try to change a field in a > record, on Windows, it takes an inordinately long time for the sqlite > code to return, the amount of time is dependent on the size of the > database but even for a 20 Meg one

Re: [sqlite] Question on how to enter blobs in sqlite3

2006-04-05 Thread Jay Sprenkle
On 4/4/06, Roman <[EMAIL PROTECTED]> wrote: > Hello, > I am using sqlite3 on am embedded platform. I am using c++ to enter data. I > have BLOB field, and I do not know how to enter hex values from a data > string. I am trying to use update, but how do I enter col_name=' data ' > format? > > How doe

Re: [sqlite] Question on how to enter blobs in sqlite3

2006-04-05 Thread Thomas Chust
On Tue, 4 Apr 2006, Roman wrote: [...] I have tried sqlite> select * from loc_configuration; 0|0|18|52|86|4|24|22|51|116|39|15|0|0|0|0|0|0|0|0|0|0|0|0 The blob is the one before the last one, and the length is the very last one The serials are second, third , fourth and fifth columns. sqlite>

[sqlite] sqlite-3.3.4 and extra float decimals

2006-04-05 Thread sqlite
Hello, When using sqlite-3.3.4 with windows I get the following strange behaviour. create table Muppet (Kermit float); insert into Muppet values (100); select * from Muppet; 100.0 As you see it returns 100.0 instead of only 100. This happens in windows xp but not in win ce. Anyone know how to f

Re: [sqlite] Strange Behaviour on Solaris 8 on Sparc

2006-04-05 Thread Christian Smith
On Wed, 5 Apr 2006, Phuah Yee Keat wrote: >Hi, > >I am currently running some tests to decide whether to use sqlite, and >bump into some strange behavior. I compiled sqlite 3.3.4 from source and >installed it on a solaris 8 on sparc without any updates. I run the same >scripts (which insert 1000 e