0001 function fields = getFields(conn)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 tblSel = findobj('Tag', 'tableSelect');
0013 tbls = get(tblSel, 'String');
0014 tbl = tbls{get(tblSel, 'Value')};
0015
0016 if ~isempty(conn)
0017
0018 try
0019 q = sprintf('describe %s', tbl);
0020 curs = exec(conn, q);
0021 curs = fetch(curs);
0022 fields = curs.Data(:,1);
0023 close(curs);
0024 catch
0025 disp(sprintf('### Server returned: %s', curs.Message));
0026 warning('!!! Can not read from database');
0027 fields = {'-'};
0028 end
0029 else
0030 fields = {'-'};
0031 end
0032