fd.typ | create table

fd = FinancialData["Groups"]
fdProperties = FinancialData["Properties"]
fdStocks = FinancialData["Stocks"]
fInancialDataGE[x_] := FinancialData["GE", x];
t = Map[fInancialDataGE, fdProperties]; 
u = Map[Head, t];

SQLCMD = "CREATE TABLE ALLPROPERTY (\n";
For[i = 0, i < Count[t, _], i++ ; 
 TYP = Piecewise[
   {
    {
     "Null"
     , MemberQ[{"Missing", "FinancialData"}, ToString[Head[t[[i]]]]]
     }
    }
   , ToString[Head[t[[i]]]]
   ];
 SQLCMD = StringJoin[
   SQLCMD
   , "  "
   , ToString[fdProperties[[i]]]
   , " "
   , TYP
   , "\n"
   ];
 Print[
  StringJoin[
   ToString[i]
   , ". "
   , ToString[fdProperties[[i]]]
   , " : "
   , ToString[FullForm[t[[i]]]]
   ]
  ];
 Print[
  StringJoin[
   "  "
   , Piecewise[
    {{StringJoin[
       ToString[Head[t[[i]]]]
       , " -> "
       , "Null"
       ], 
      MemberQ[{"Missing", "FinancialData"}, ToString[Head[t[[i]]]]]}}
    , ToString[Head[t[[i]]]]
    ]
   ]
  ]
 ]
SQLCMD = StringJoin[
  SQLCMD
  , ")"
  ]
SQLCMD
Comments