Home > FMAToolbox > Database > DBList.m

DBList

PURPOSE ^

DBList - List existing databases.

SYNOPSIS ^

function databases = DBList(pattern)

DESCRIPTION ^

DBList - List existing databases.

  USAGE

    databases = DBList(pattern)

    pattern        optional name search pattern (see below)

  EXAMPLES

    % List all databases
    databases = DBList;

    % List all databases starting with 'LFP'
    databases = DBList('LFP.*');

  SEE

    See also DBConnect.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function databases = DBList(pattern)
0002 
0003 %DBList - List existing databases.
0004 %
0005 %  USAGE
0006 %
0007 %    databases = DBList(pattern)
0008 %
0009 %    pattern        optional name search pattern (see below)
0010 %
0011 %  EXAMPLES
0012 %
0013 %    % List all databases
0014 %    databases = DBList;
0015 %
0016 %    % List all databases starting with 'LFP'
0017 %    databases = DBList('LFP.*');
0018 %
0019 %  SEE
0020 %
0021 %    See also DBConnect.
0022 %
0023 
0024 % Copyright (C) 2012-2013 by Michaƫl Zugaro
0025 %
0026 % This program is free software; you can redistribute it and/or modify
0027 % it under the terms of the GNU General Public License as published by
0028 % the Free Software Foundation; either version 3 of the License, or
0029 % (at your option) any later version.
0030 
0031 % Make sure MyM is installed and functional
0032 CheckMyM;
0033 
0034 try
0035     h = mym('show databases;');
0036 catch
0037     error(['Could not list databases (check DB server connection).']);
0038 end
0039 databases = h.Database;
0040 
0041 if nargin >= 1,
0042     databases = regexp(databases,pattern,'match');
0043     databases = vertcat(databases{:});
0044 end

Generated on Fri 16-Mar-2018 13:00:20 by m2html © 2005