Main Content

listDataSources

List all available data sources

Since R2020b

Description

example

list = listDataSources() returns a list of all available data sources on the system. Specify a data source name using the database function to connect to a database at the command line. Or, in the Database Explorer app, click Connect in the Connections section, and then select a data source name from the list.

Examples

collapse all

Retrieve a list of all data sources on the system.

list = listDataSources
list=2×3 table
            Name             DriverType            Vendor        
    _____________________    __________    ______________________

    "MSSQLServerAuth"          "ODBC"      <missing>             
    "MSSQLServerJDBCAuth"      "JDBC"      "Microsoft SQL Server"

list is a table with three variables for the data source name, driver type, and database vendor. The variable for the database vendor contains values for JDBC and native interfaces only.

Each row represents an existing data source on the system.

Output Arguments

collapse all

List of data sources, returned as a table.

For ODBC interfaces, the listDataSources function retrieves data sources that you define using the ODBC Data Source Administrator dialog box, which you can open by using the configureODBCDataSource function.

For JDBC and native interfaces, the listDataSources function retrieves data sources that you define using the JDBC Data Source Configuration dialog box or the databaseConnectionOptions function at the command line.

Version History

Introduced in R2020b