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
--------    ------
Anne    21
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

Reply via email to