Last change
on this file was
4,
checked in by zhangj, 11 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
717 bytes
|
Line | |
---|
1 | function dbdrop(varargin) |
---|
2 | % DBDROP Delete a MySQL database |
---|
3 | % INPUTS : DBNAME - database name, string (optional, current database default) |
---|
4 | % OUTPUTS : None |
---|
5 | % EXAMPLE : dbdrop('junkdb') |
---|
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 == 0 |
---|
12 | if ~isempty(dbcurr) |
---|
13 | mym(['drop database ' dbcurr]) |
---|
14 | else |
---|
15 | error('No database currently selected. Use DBOPEN to open a database.') |
---|
16 | end |
---|
17 | else |
---|
18 | dbase = varargin{1}; |
---|
19 | try |
---|
20 | mym(['drop database ' dbase]) |
---|
21 | catch |
---|
22 | error(['Database ' dbase ' could not be deleted. Use DBLIST to list available databases.']) |
---|
23 | end |
---|
24 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.