get the selected table
0001 function fields = getFields(conn) 0002 0003 0004 % get the selected table 0005 tblSel = findobj('Tag', 'tableSelect'); 0006 tbls = get(tblSel, 'String'); 0007 tbl = tbls{get(tblSel, 'Value')}; 0008 0009 if ~isempty(conn) 0010 % get the databases 0011 q = sprintf('describe %s', tbl); 0012 curs = exec(conn, q); 0013 curs = fetch(curs); 0014 0015 fields = curs.Data(:,1); 0016 close(curs); 0017 else 0018 fields = {'-'}; 0019 end 0020