On 30 Apr 2010, at 3:57pm, David Lyon wrote:

> if I had many many files like this:
> http://research.stowers-institute.org/efg/ScientificSoftware/Utility/FCSExtract/CC4_067_BM.txt
> 
> you see 2 columns keyword and value, the keywords would be the fields  (1st 
> column in the html link above) in the table while the values (second column) 
> are the data I would insert.
> 
> The fields will be many and include 
> 
> P$nR
> P$nS
> P$nB
> 
> etc.
> 
> thats why I wanted a quick way to access "select P%R from TABLE";

Defining that many columns is not a good way to store values in a database.  It 
would be better to make a table with three columns: dataset, fieldName and 
fieldValue, then one row of the table would be

        dataset         fieldName       fieldValue
        CC4_067_BM      P4R             4096

Then you can select the fields you want using the LIKE or GLOB filters you'd 
normally use to find values in a table.  You can also very simply find all the 
datasets that have a particular value for a particular field.

It's better to make the process of reading the data in more complicated if that 
makes the process of getting it back out simpler and faster.  You're only going 
to put data in once, but you'll be wanting to read it back out many times.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to