Re: [sqlite] sql problem

2006-02-08 Thread manoj marathayil
i am able to get the result but the problem is it is case sensitive, i want a case insensitive manoj marathayil <[EMAIL PROTECTED]> wrote: i have two tables like this; CREATE TABLE sp_objects ( dbname varchar(256), object_name varchar (256), arglist varchar(256), type integer, primary key ( dbn

[sqlite] sql problem

2006-02-08 Thread manoj marathayil
i have two tables like this; CREATE TABLE sp_objects ( dbname varchar(256), object_name varchar (256), arglist varchar(256), type integer, primary key ( dbname, object_name, arglist ) ); CREATE TABLE sp_objects ( dbname varchar(256), object_name varchar (256), arglist varchar(256

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread Randall
Many thanks again, I'll give it a try.. Best, randall

Re: [sqlite] String to numeric conversion

2006-02-08 Thread rbundy
Please leave the current functionality as is. I believe it is the role of the host language to perform any editing or translation of data, such as the removal of leading or trailing spaces, not the SQL engine. Regards. rayB ** PLEASE CONSIDER OUR ENVIRONMENT BEFORE PRINTING ***

Re: [sqlite] String to numeric conversion

2006-02-08 Thread Chris Schirlinger
I'd say leave it as it is .. ie "12.34" is a string "12.34" is a number This way you have all the options you need and it's up to the coder to decide what they want. If " 12.34" is a string it's fine If " 12.34" is *NOT* a string, then TRIM it and pass it SQLite cleaned up If you chan

[sqlite] String to numeric conversion

2006-02-08 Thread drh
Ticket #1662 (http://www.sqlite.org/cvstrac/tktview?tn=1662) complains that SQLite is not converting strings into numbers if the string contains leading spaces. This happens because SQLite just hands the string to strtod() and strtod() does not recognize numbers with leading spaces. (Actually, st

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Jim C. Nasby
In the case of PostgreSQL, avg is actually returning numeric when handed an int. On Wed, Feb 08, 2006 at 11:26:37AM -0800, Rich Shepard wrote: > On Wed, 8 Feb 2006, Paul Tomblin wrote: > > >In PostgreSQL 7.3, I get the same: > > Also in postgres-8.1.2. I entered the reals with a decimal point;

Re: [sqlite] SQLite to MySQL

2006-02-08 Thread Jim C. Nasby
See also http://sql-info.de/mysql/gotchas.html. About the only downsides I can think of with PostgreSQL is that it's out-of-the-box configuration is meant for like a 486 and that not quite as many hosting providers offer it. That url has about 100 downsides to MySQL (many of which are rather serio

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread Jim C. Nasby
On Wed, Feb 08, 2006 at 08:33:48AM +0100, Arjen Markus wrote: > Paul Tomblin wrote: > > > > I am putting together something that will act like a Wiki for structured > > data (in this case, airport and navigation aid data like id, location, > > runways, etc). I currently store the data in an SQL d

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread drh
"Randall" <[EMAIL PROTECTED]> wrote: > Thanks again! > I cannot see 3.3.2 at the download site..? > It is not on the download page, but you can probably guess the correct URL by making a minor change to the link for the 3.3.3 download. -- D. Richard Hipp <[EMAIL PROTECTED]>

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread Randall
Thanks again! I cannot see 3.3.2 at the download site..? You should be good to go if you use version 3.3.2. It doesn't have the fix that broke ".import" in version 3.3.3, but it does have the "if exists/if not exists" features introduced in version 3.3.0. HTH Dennis Cote

Re: [sqlite] Separate INTEGER and REAL affinity ?

2006-02-08 Thread drh
Zibetti Paolo <[EMAIL PROTECTED]> wrote: > I read in the "changes" page of the SQLite site that version 3.3.x of SQLite > features "Separate INTEGER and REAL affinity". > > What does this exactly mean ? > How is SQLite 3.3.x different from 2.8.x with respect to column affinity ? > Version 2 stor

Re: [sqlite] future of sqlite

2006-02-08 Thread drh
Roberto <[EMAIL PROTECTED]> wrote: > Never seen such a list, but if you have the time & effort to look at > he CVS source, it might give you a clue about what's coming up in the > next release. > Rather than look at the source code directly, it would probably be easier to look at the recent check

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Marian Olteanu
Probably the best solution would be to have the standard implementation activated by a PRAGMA command. This way, you don't steal functionality from people who want non-standard implementation and you also don't risk to break compatibility with existing software over SQLite (you have backward co

Re: [sqlite] future of sqlite

2006-02-08 Thread Roberto
Never seen such a list, but if you have the time & effort to look at he CVS source, it might give you a clue about what's coming up in the next release. On 08/02/06, Miguel Angel Latorre Díaz <[EMAIL PROTECTED]> wrote: > Is there any list of future enhancements, new features, etc on sqlite we can

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Dennis Cote
In Summary, we have 4 database engines that appear to follow the standard, and 6 that do not. Standard: MS SQL 2000 Firebird 1.5 MS SQL 2005 DB2 8.2 Non-standard: MS Access PostgreSQL 7.3 PostgreSQL 8.1.2 MySQL 5.0 Informix 7.31 Oracle 10.1 It is also interesting

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Dennis Cote
Oops... That should, of course, be *inconsistency*. On 2/8/06, Dennis Cote <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > > >Did you try sum(a)/count(a) instead of avg(a). > > > > SQLite version 3.3.3 > > Enter ".help" for instructions > > sqlite> create table t (a integer, b

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Did you try sum(a)/count(a) instead of avg(a). SQLite version 3.3.3 Enter ".help" for instructions sqlite> create table t (a integer, b real); sqlite> insert into t values (3, 3); sqlite> insert into t values (3, 3); sqlite> insert into t values (4, 4); s

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread Dennis Cote
Randall wrote: Thanks, Catch 22; I can't upgrade because ".import" is not working again till 3.3.4! Best, Randall Randall, You should be good to go if you use version 3.3.2. It doesn't have the fix that broke ".import" in version 3.3.3, but it does have the "if exists/if not exists" featu

Re: [sqlite] SQLite to MySQL

2006-02-08 Thread John Stanton
PostgreSQL implements standard SQL as well as the features of an enterprise DBMS. On that basis if you are changing it makes sense to change to the fuller-featured product, one in the same class as Oracle and DB2. In the short term Mysql could be as good as PostgreSQL. Fanda Vacek wrote: I'm

Re: [sqlite] Fwd: Help regarding insertion into database

2006-02-08 Thread John Stanton
pavan savoy wrote: -- Forwarded message -- From: pavan savoy <[EMAIL PROTECTED]> Date: Feb 8, 2006 5:22 PM Subject: Help regarding insertion into database To: [EMAIL PROTECTED] Hi, Inside C program I have a structure and want to store it into a database, isnt there any d

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread Randall
Thanks, Catch 22; I can't upgrade because ".import" is not working again till 3.3.4! Best, Randall

RE: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Thomas Briggs
Oracle 10.1 AVG(A) AVG(B) -- -- 3. 3. SQL 2005 --- -- 3 3.33 DB2 8.2 1 2 --- 3 +3.33E+000 > -Origi

RE: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Griggs, Donald
FWIW, Informix 7.31 returns REALs for both averages and also for sum(a)/count(a) Donald Griggs Opinions are not necessarily those of Misys Healthcare Systems nor its board of directors. -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 08, 200

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Nemanja Corlija
On 2/8/06, Dennis Cote <[EMAIL PROTECTED]> wrote: > create table t (a integer, b real); > insert into t values (3, 3); > insert into t values (3, 3); > insert into t values (4, 4); > select avg(a), avg(b) from t; MySQL 5.0 3. 3.3 Firebird 1.5 3 3.33 --

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > > I'm particularly interested in the value of avg(a). My reading of the > standard leads me to believe that avg(a) should be 3 (i.e. an integer > value) and not a floating point value. This is similar to the earlier > discussion of the results for divisi

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Rich Shepard
On Wed, 8 Feb 2006, Paul Tomblin wrote: In PostgreSQL 7.3, I get the same: Also in postgres-8.1.2. I entered the reals with a decimal point; made no difference. Rich -- Richard B. Shepard, Ph.D. | Author of "Quantifying Environmental Applied Ecosystem Services, Inc. (TM)

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Jay Sprenkle
On 2/8/06, Dennis Cote <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a question that I hope you can help with. I would like to know > what results other database engines (i.e. mySQL, PostgreSQL, Firebird, > Oracle, MS SQL, etc) give for the following SQL. > > create table t (a integer, b real

Re: [sqlite] testing Avg() function in other database engines

2006-02-08 Thread Paul Tomblin
Quoting Dennis Cote ([EMAIL PROTECTED]): > In SQLite I get the following: > >SQLite version 3.3.2 >Enter ".help" for instructions >sqlite> create table t (a integer, b real); >sqlite> insert into t values (3, 3); >sqlite> insert into t values (3, 3); >sqlite> insert into t

[sqlite] testing Avg() function in other database engines

2006-02-08 Thread Dennis Cote
Hi All, I have a question that I hope you can help with. I would like to know what results other database engines (i.e. mySQL, PostgreSQL, Firebird, Oracle, MS SQL, etc) give for the following SQL. create table t (a integer, b real); insert into t values (3, 3); insert into t values

Re: [sqlite] question about performance

2006-02-08 Thread Xavier Noria
On Feb 8, 2006, at 17:24, [EMAIL PROTECTED] wrote: If you do not do a BEGIN...COMMIT around your inserts, then each insert has an implied BEGIN...COMMIT around itself. That means you are doing 50 COMMITs. A COMMIT is slow because it is "Durable" (The "D" in ACID). That means that the operation

Re: [sqlite] question about performance

2006-02-08 Thread Christian Smith
On Wed, 8 Feb 2006, Xavier Noria wrote: >On Feb 8, 2006, at 17:10, Doug Nebeker wrote: > >> When you don't wrap everything in a transaction, each statement becomes >> it's own transaction. And the database file is opened, updated, and >> closed on each transaction. So your first case had roughly

Re: [sqlite] question about performance

2006-02-08 Thread Xavier Noria
On Feb 8, 2006, at 17:10, Doug Nebeker wrote: When you don't wrap everything in a transaction, each statement becomes it's own transaction. And the database file is opened, updated, and closed on each transaction. So your first case had roughly 50 times the amount of file I/O and transacti

Re: [sqlite] question about performance

2006-02-08 Thread drh
Xavier Noria <[EMAIL PROTECTED]> wrote: > I have a simple schema and a sql loader that fills a table with > initial values: > >delete from foo; >insert into foo ...; >insert into foo ...; >... about 50 inserts ... > > To my surprise, the execution of these inserts took a few sec

RE: [sqlite] question about performance

2006-02-08 Thread Doug Nebeker
When you don't wrap everything in a transaction, each statement becomes it's own transaction. And the database file is opened, updated, and closed on each transaction. So your first case had roughly 50 times the amount of file I/O and transaction startup/commit overhead as the second case. -

Re: [sqlite] question about performance

2006-02-08 Thread Clay Dowling
Xavier Noria said: > I have a simple schema and a sql loader that fills a table with > initial values: > >delete from foo; >insert into foo ...; >insert into foo ...; >... about 50 inserts ... > > To my surprise, the execution of these inserts took a few seconds > (SQLite is 3.3.3)

[sqlite] question about performance

2006-02-08 Thread Xavier Noria
I have a simple schema and a sql loader that fills a table with initial values: delete from foo; insert into foo ...; insert into foo ...; ... about 50 inserts ... To my surprise, the execution of these inserts took a few seconds (SQLite is 3.3.3). However, if I wrapped the entire lo

Re: [sqlite] Versioning in SQL database?

2006-02-08 Thread Dennis Cote
Randall wrote: Hi, I acnnot get "IF EXISTS" to work for "DROP TABLE IF EXISTS tablename"; ver 3.2.8; I see "IF NOT EXISTS" started in ver 3.3.0, but "IF EXISTS" has been in the syntax page for at least months; am I doing something wrong? Randall Randal, It works fine for me in version 3.3.

Re: [sqlite] SQLite to MySQL

2006-02-08 Thread Fanda Vacek
I'm not sure, if Postgres is better choice than MySQL. I have used both of them to find out which is the better one. Both of them can do almost anything. The choice is a matter of taste and person. We are free to choose:)) I'm talking about MySQL 5 and PostgreSQL 8.1. Sorry for writing this

Re: [sqlite] Fwd: Help regarding insertion into database

2006-02-08 Thread Martin Engelschalk
Hi, yes, you could use a blob (binary lagre object): create table tab (MyData blob); then use sqlite3_prepare() to prepare an insert statement and bind your structure using sqlite3_bind_blob(). To retrieve the data, use sqlite3_column_blob() on your result set. These functions are documented h

Re: [sqlite] Fwd: Help regarding insertion into database

2006-02-08 Thread Clay Dowling
pavan savoy said: > -- Forwarded message -- > From: pavan savoy <[EMAIL PROTECTED]> > Date: Feb 8, 2006 5:22 PM > Subject: Help regarding insertion into database > To: [EMAIL PROTECTED] > > Hi, > > Inside C program I have a structure and want to store it into a > database,

[sqlite] future of sqlite

2006-02-08 Thread Miguel Angel Latorre Díaz
Is there any list of future enhancements, new features, etc on sqlite we can drool for?

[sqlite] Fwd: Help regarding insertion into database

2006-02-08 Thread pavan savoy
-- Forwarded message -- From: pavan savoy <[EMAIL PROTECTED]> Date: Feb 8, 2006 5:22 PM Subject: Help regarding insertion into database To: [EMAIL PROTECTED] Hi, Inside C program I have a structure and want to store it into a database, isnt there any datatype where I could

[sqlite] IF EXISTS

2006-02-08 Thread Randall
Hi, I acnnot get "IF EXISTS" to work for "DROP TABLE IF EXISTS tablename"; ver 3.2.8; I see "IF NOT EXISTS" started in ver 3.3.0, but "IF EXISTS" has been in the syntax page for at least months; am I doing something wrong? Randall