Last change
on this file since 4 was
4,
checked in by zhangj, 10 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
749 bytes
|
Line | |
---|
1 | function[names] = tblist(varargin) |
---|
2 | % TBLIST List tables in a MySQL database |
---|
3 | % INPUTS : DBASE - database name, string (optional, current database default) |
---|
4 | % OUTPUTS : NAMES - list of table names, (m x 1) cell array |
---|
5 | % EXAMPLE : tblist('project1') |
---|
6 | % AUTHOR : Dimitri Shvorob, dimitri.shvorob@vanderbilt.edu, 8/7/06 |
---|
7 | error(nargchk(0,1,nargin)) |
---|
8 | if ~mycheck |
---|
9 | error('No MySQL instance detected. Use MYOPEN to connect.') |
---|
10 | end |
---|
11 | if nargin |
---|
12 | dbase = varargin{1}; |
---|
13 | else |
---|
14 | dbase = dbcurr; |
---|
15 | if isempty(dbcurr) |
---|
16 | error('No database currently selected. Use DBOPEN to open a database.') |
---|
17 | end |
---|
18 | end |
---|
19 | try |
---|
20 | names = mym(['show tables in ' dbase]); |
---|
21 | catch |
---|
22 | error(['Database ' dbase ' not found. Use DBLIST to list available databases.']) |
---|
23 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.