source: MML/trunk/applications/database/mym/utilities/tbprint.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 717 bytes
Line 
1function tbprint(table,varargin)
2% TBPRINT   Show several rows of a MySQL table
3% INPUTS  : TABLE - table name, string
4% OUTPUTS : None
5% EXAMPLE : tbprint('mytable')
6% NOTES   : All rows of TABLE  will be  displayed if their number  is below
7%           50; otherwise, 10 first and 10 last rows will be shown. You can
8%           change TBPRINT behavior by editing line 16, e.g. adding a LIMIT
9%           clause.
10% AUTHOR  : Dimitri Shvorob, dimitri.shvorob@vanderbilt.edu, 8/7/06
11error(nargchk(1,2, nargin))
12if ~mycheck
13   error('No MySQL instance detected. Use MYOPEN to connect.')
14end
15try
16  mym(['select * from ' table]);
17catch
18  error(['Table ' table ' not found. Use TBLIST to list available tables.'])
19end
Note: See TracBrowser for help on using the repository browser.