The following works:
devFactors =SQLExecute[SicsDBconnection, "SELECT * FROM " <> devFactorTable];
devFactors[[1]]
colNames = {ALOB, Country, Months, LossFactor, EarnedFactor};
asRules = Rule @@@ Transpose[{colNames, Range[Length@colNames]}];
newList[col_] := devFactors[[All, col /. asRules]];
newList[LossFactor][[1]]
and produces:
{"Property Treaty PR", "Morristown", 12, 3.5736, 3.09256}
3.5736
I would like to pull those column names from SQL as the following:
colNames = SQLColumnNames[SicsDBconnection, SQLTable[devFactorTable]][[All, 2]];
But, when I do this, colNames now is a list of strings instead of a list of symbols and I have to reference my devFactors list like:
newList["LossFactor"][[1]]
I would like to be able to reference it using the symbol LossFactor instead of the string. I see that I can't replace the head of an atom, so I think that means that I can't turn those strings from SQL into symbols.
Obviously this isn't a critical problem, but does anyone know how I can accomplish this, or if it's possible?