[sqlite] Fwd: Help! Excel-->SQLite -- getting numbers to behave like numbers!

2008-10-26 Thread David Akin
Cancel that last plea of help: Excel was adding a trailng space in one
of the fields containing numbers which I did not discover until
looking at the CSV file in text editor. A quick search-and-replace
later, I've dumped the data backed into SQLite and problem is solved
...




-- Forwarded message --
From: David Akin <[EMAIL PROTECTED]>
Date: Sun, Oct 26, 2008 at 2:37 PM
Subject: Help! Excel-->SQLite -- getting numbers to behave like numbers!
To: sqlite-users@sqlite.org


I'm fiddling with SQLite running on Mac OSX and am using the Firefox
extension SQLite Manager ...

I have some Excel tables I'd like to re-create in SQLite.

It looks easy to me:
1. Save your Excel table as a .csv file.
2. In SQLite Manager used DATABASE-->IMPORT ... and follow the directions.

Great. There's my table looking all spiffy in an SQL manager except
that numbers ain't acting like numbers. Here's what I mean:

Here's my table

NAME   AGE
--
Fred  9
Anne   21
Ruth   97

When I ask SQLite to sort the table from youngest to oldest, it returns:

NAME   AGE
--
Anne21
Fred   9
Ruth 97

In the AGE column, the DB is apparently looking only at the first
character in the AGE field and sorting on that. It is not treating the
string in AGE as a complete INTEGER. Now I can go in and edit the each
record within SQLIte, keying in the values each time for AGE and the
database will then sort as if the contents of AGE are, in fact, an
integer. But the real data set I'm working with as 1,600 plus records
and I'd rather not go through all that :)

Now I'm no SQL super-jock so maybe I'm not declaring something
properly in the statement that created the table: Here it is; the
table is called  BIRTHDAYS

CREATE TABLE "BIRTHDAYS" ("NAME" TEXT,"AGE" NUMERIC NOT NULL )

Note: I've also tried the giving the AGE field other numeric datatypes
such as INTEGER and FLOATING ...

Thanks!


--
David Akin
---
http://www.davidakin.com



--
David Akin
-------
http://www.davidakin.com



-- 
David Akin
---
http://www.davidakin.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Help! Excel-->SQLite -- getting numbers to behave like numbers!

2008-10-26 Thread David Akin
I'm fiddling with SQLite running on Mac OSX and am using the Firefox
extension SQLite Manager ...

I have some Excel tables I'd like to re-create in SQLite.

It looks easy to me:
1. Save your Excel table as a .csv file.
2. In SQLite Manager used DATABASE-->IMPORT ... and follow the directions.

Great. There's my table looking all spiffy in an SQL manager except
that numbers ain't acting like numbers. Here's what I mean:

Here's my table

NAME   AGE
--
Fred  9
Anne   21
Ruth   97

When I ask SQLite to sort the table from youngest to oldest, it returns:

NAME   AGE
--
Anne21
Fred   9
Ruth 97

In the AGE column, the DB is apparently looking only at the first
character in the AGE field and sorting on that. It is not treating the
string in AGE as a complete INTEGER. Now I can go in and edit the each
record within SQLIte, keying in the values each time for AGE and the
database will then sort as if the contents of AGE are, in fact, an
integer. But the real data set I'm working with as 1,600 plus records
and I'd rather not go through all that :)

Now I'm no SQL super-jock so maybe I'm not declaring something
properly in the statement that created the table: Here it is; the
table is called  BIRTHDAYS

CREATE TABLE "BIRTHDAYS" ("NAME" TEXT,"AGE" NUMERIC NOT NULL )

Note: I've also tried the giving the AGE field other numeric datatypes
such as INTEGER and FLOATING ...

Thanks!


--
David Akin
---
http://www.davidakin.com



-- 
David Akin
---
http://www.davidakin.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users