0001 function tbl = mysql_describe_table(table, conn_id, params)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 try conn_id(1);
0014 catch
0015 if exist('params','var')
0016 tmp_conn_id = 1;
0017 if ~isfield(params,'conn_id')
0018 params.conn_id = 0;
0019 end
0020 conn_id = mysql_make_conn(params);
0021 else
0022 error('%s: No valid conn_id provided', mfilename)
0023 end
0024 end
0025
0026 [tbl.flds,tbl.types,tbl.null, tbl.key,tbl.default,tbl.extra] = ...
0027 mysql(conn_id,sprintf('DESCRIBE %s', table));
0028
0029
0030 if (exist('tmp_conn_id','var'))
0031 mysql(conn_id,'close');
0032 end