Quantcast

Documentation Center

  • Trial Software
  • Product Updates

get

Retrieve object properties

Syntax

Description

example

s = get(object) returns a structure that contains object and its corresponding properties, and assigns the structure to s.

example

v = get(object,property) retrieves the value of property for object and assigns the value to v.

Examples

expand all

Get Database Metadata Object Properties

Retrieve the properties of a database metadata object created using a database connection object.

Establish connection conn to a MySQL® database with user name username and password pwd.

conn = database('MySQL','username','pwd');

Construct a database metadata object dbmeta using the database connection object conn.

dbmeta = dmd(conn);

Retrieve the properties of dbmeta and assign them to MATLAB® variable v.

v = get(dbmeta)
v = 

                 AllProceduresAreCallable: 1
                   AllTablesAreSelectable: 1
    DataDefinitionCausesTransactionCommit: 1
      DataDefinitionIgnoredInTransactions: 0
               DoesMaxRowSizeIncludeBlobs: 0
                                 Catalogs: {8x1 cell}
                         CatalogSeparator: '.'
                              CatalogTerm: 'DATABASE'
                      DatabaseProductName: 'ACCESS'
                   DatabaseProductVersion: '04.00.0000'
              DefaultTransactionIsolation: 2
                       DriverMajorVersion: 2
                       DriverMinorVersion: 1
                               DriverName: 'JDBC-ODBC Bridge (ACEODBC.DLL)'
                            DriverVersion: '2.0001 (Microsoft Access database engine)'
                      ExtraNameCharacters: '~@#$%^&*_-+=\}{"';:?/><,.![]|'
                    IdentifierQuoteString: '`'
                         IsCatalogAtStart: 1
                   MaxBinaryLiteralLength: 255
                     MaxCatalogNameLength: 260
                     MaxCharLiteralLength: 255
                      MaxColumnNameLength: 64
                      MaxColumnsInGroupBy: 10
                        MaxColumnsInIndex: 10
                      MaxColumnsInOrderBy: 10
                       MaxColumnsInSelect: 255
                        MaxColumnsInTable: 255
                           MaxConnections: 64
                      MaxCursorNameLength: 64
                           MaxIndexLength: 255
                   MaxProcedureNameLength: 64
                               MaxRowSize: 4052
                      MaxSchemaNameLength: 0
                       MaxStatementLength: 65000
                            MaxStatements: 0
                       MaxTableNameLength: 64
                        MaxTablesInSelect: 16
                        MaxUserNameLength: 0
                         NumericFunctions: [1x73 char]
                            ProcedureTerm: 'QUERY'
                                  Schemas: {}
                               SchemaTerm: ''
                       SearchStringEscape: '\'
                              SQLKeywords: [1x255 char]
                          StringFunctions: [1x91 char]
               StoresLowerCaseIdentifiers: 0
         StoresLowerCaseQuotedIdentifiers: 0
               StoresMixedCaseIdentifiers: 0
         StoresMixedCaseQuotedIdentifiers: 1
               StoresUpperCaseIdentifiers: 0
         StoresUpperCaseQuotedIdentifiers: 0
                          SystemFunctions: ''
                               TableTypes: {18x1 cell}
                        TimeDateFunctions: [1x111 char]
                                 TypeInfo: {16x1 cell}
                                      URL: 'jdbc:odbc:tutorial2'
                                 UserName: 'admin'
                    NullPlusNonNullIsNull: 0
                      NullsAreSortedAtEnd: 0
                    NullsAreSortedAtStart: 0
                       NullsAreSortedHigh: 0
                        NullsAreSortedLow: 1
                    UsesLocalFilePerTable: 0
                           UsesLocalFiles: 1

Display the contents of the Catalogs property of v.

v.Catalogs
ans = 
    'D:\matlab\toolbox\database\dbdemos\db1'
    'D:\matlab\toolbox\database\dbdemos\origtutorial'
    'D:\matlab\toolbox\database\dbdemos\tutorial'
    'D:\matlab\toolbox\database\dbdemos\tutorial1'

Close the connection.

close(conn);

Get the AutoCommit Flag Status

Retrieve the 'AutoCommit' property of the database connection object.

Establish connection conn to a MySQL database with user name username and password pwd.

conn = database('MySQL','username','pwd');

Check the status of the 'AutoCommit' property for the database connection conn.

v = get(conn,'AutoCommit')
v = 
	on

Close the connection.

close(conn);

Input Arguments

expand all

object — Database Toolbox™ objectdatabase connection object | cursor object | driver object | ...

Database Toolbox object, specified as the following allowable objects:

  • Database connection object, which is created using database

  • Cursor object, which is created using exec or fetch

  • Driver object, which is created using driver

  • Database metadata object, which is created using dmd

  • Drivermanager object, which is created using drivermanager

  • Resultset object, which is created using resultset

  • Resultset metadata object, which is created using rsmd

For a list of properties for each object, see Using the get Function.

property — Property of Database Toolbox objectstring

Property of the Database Toolbox object, specified as a string.

Data Types: char

Output Arguments

expand all

s — Object propertiesstructure

Object properties, returned as a structure that contains the object and its corresponding properties.

v — Object property valuestring | numeric | cell array | object

Object property value, returned as a string, numeric value, cell array, or object.

See Also

| | | | | | | | | | |

Was this topic helpful?