Main Content

deleteDataSource

Delete data source

Since R2020b

Description

deleteDataSource(datasource) deletes the specified data source.

example

Examples

collapse all

Delete an existing JDBC data source for a Microsoft® SQL Server® database.

List the configured data sources on the system. The JDBC data source SQLServerDataSource is an existing data source on the system.

listDataSources
ans=3×3 table
            Name             DriverType            Vendor        
    _____________________    __________    ______________________

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

Delete the SQL Server data source SQLServerDataSource.

datasource = "SQLServerDataSource";
deleteDataSource(datasource)

List the configured data sources again. The list of existing data sources does not contain the SQLServerDataSource data source.

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

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

Input Arguments

collapse all

Data source name, specified as a character vector or string scalar. Specify the name of an existing data source.

Example: "myDataSource"

Data Types: char | string

Version History

Introduced in R2020b