Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

schemas

(To be removed) Get database schema names

schemas will be removed in a future release. Use the Schemas connection object property instead.

Syntax

s = schemas(conn)

Description

example

s = schemas(conn) retrieves schema names in a database using the database connection conn.

Examples

collapse all

Create a database connection conn to the Oracle® database using the JDBC driver. Use the Vendor name-value pair argument of database to specify a connection to an Oracle database. To connect without Windows® authentication, use the DriverType name-value pair argument of database to specify a connection to the database server by specifying the thin value. Here, this code assumes that you are connecting to a database named dbname with user name username and password pwd. This code assumes that you are using the database server named sname and port number 123456.

conn = database('dbname','username','pwd',...
                'Vendor','Oracle','DriverType','thin',...
                'Server','sname','PortNumber',123456);

Alternatively, use the native ODBC interface for an ODBC connection. For details, see database.

Retrieve the schema names in the database named dbname using the database connection conn.

s = schemas(conn)
s = 

  Columns 1 through 4

    'ANONYMOUS'    'APEX_040200'    'APEX_PUBLIC_USER'    'APPQOSSYS'

  Columns 5 through 10

    'AUDSYS'    'CTXSYS'    'DBSNMP'    'DIP'    'DVF'    'DVSYS'

  ...

s returns a cell array of schema names in the Oracle database.

Close the connection.

close(conn)

Input Arguments

collapse all

Database connection, specified as a connection object created using the database function.

Output Arguments

collapse all

Schema names, returned as a cell array containing the names of the schemas in the database. The contents of s that you see depend upon your permission settings in the database.

Introduced in R2010a

Was this topic helpful?