source: MML/trunk/applications/database/mym/utilities/dbdrop.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 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
7error(nargchk(0,1,nargin))
8if ~mycheck
9   error('No MySQL instance detected. Use MYOPEN to connect.')
10end
11if 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   
17else
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
24end   
Note: See TracBrowser for help on using the repository browser.