database toolbox

4
Database Toolbox Exchange data with relational databases Database Toolbox™ provides an app and functions for exchanging data between relational databases and MATLAB ® . You can use SQL commands to read and write data or use the Database Explorer app to interact with a database without using SQL. The toolbox supports ODBC-compliant and JDBC-compliant databases, including Oracle ® , MySQL ® , Sybase ® , Microsoft ® SQL Server ® , and Informix ® . You can apply simple and advanced conditions to database queries from MATLAB. The toolbox lets you access multiple databases simultaneously within a single MATLAB session and enables segmented import of large data sets. Key Features Database Explorer app for working with databases interactively JDBC-compliant database connections ODBC-compliant database connections, with the option for fast access via a native ODBC driver Functions for executing queries using SQL files and SQL statements Data import and export with multiple databases in a single session Large data set import via a single transaction or via multiple transactions of segmented data Direct data import into numeric, cell, structure, and dataset arrays 1

Upload: saurabh-kumar

Post on 06-Sep-2015

252 views

Category:

Documents


0 download

DESCRIPTION

Matlab Database Toolbox

TRANSCRIPT

  • Database ToolboxExchange data with relational databases

    Database Toolbox provides an app and functions for exchanging data between relational databases andMATLAB. You can use SQL commands to read and write data or use the Database Explorer app to interact with adatabase without using SQL.

    The toolbox supports ODBC-compliant and JDBC-compliant databases, including Oracle, MySQL, Sybase,Microsoft SQL Server, and Informix. You can apply simple and advanced conditions to database queries fromMATLAB. The toolbox lets you access multiple databases simultaneously within a single MATLAB session andenables segmented import of large data sets.

    Key Features Database Explorer app for working with databases interactively JDBC-compliant database connections ODBC-compliant database connections, with the option for fast access via a native ODBC driver Functions for executing queries using SQL files and SQL statements Data import and export with multiple databases in a single session Large data set import via a single transaction or via multiple transactions of segmented data Direct data import into numeric, cell, structure, and dataset arrays

    1

  • Database Explorer (top) and automatically generated SQL statements (bottom).

    Importing Data into MATLAB

    Database Toolbox supports standard SQL commands, such as those for further defining data to import and forretrieving data from specific objects. After you import the data into MATLAB, you can view attributes of theimported data, as well as the data itself, and use MATLAB commands to process the data. Finally, you can savethese commands in a MATLAB program file for automating this process later.

    Using Scripts and Stored Procedures

    With Database Toolbox, you can execute scripts and stored procedures for:

    Directly executing SQL scripts within MATLAB and storing the results for further processing Calling stored procedures within databases and passing parameters between MATLAB and the database Retrieving data from a cursor object that contains multiple result sets

    Working with Multiple Databases

    Database Toolbox enables you to connect to multiple data sources within a single session and browse databasesassociated with each source. Within MATLAB, you can construct queries to separately retrieve selected data fromeach database for combined processing.

    Importing Large Data Sets

    Database Toolbox enables you to extract data from large data sets in a segmented and sequential manner. You canretrieve all data at once or a subset of the data.

    2

  • Native ODBC Driver

    Database Toolbox enables you to connect to ODBC-compliant databases using a native ODBC interface. You canrun queries and stored procedures, import data from the database, and export data all at once or in batches.

    Database Toolbox commands showing how to import a column of data from a table.

    Exporting Data to a Database

    After completing calculations or data manipulation in MATLAB, you can export the results by placing the datainto a matrix, cell array, or structure and defining database column names to which this data is written. You canexport the results as new data or update the original data completely or conditionally.

    Transacting with Supported Databases

    For added security, Database Toolbox enables transactional exchange of data with supported databases thatprovide this feature. You can:

    Access auto-commit functions of the underlying database Make changes to the database permanent Undo any changes made since the last time changes were committed or rolled back

    Database Toolbox commands showing how to export a MATLAB array into a table in the sample database. Thevariable stores the names of relevant columns.

    3

  • Product Details, Examples, and System Requirementswww.mathworks.com/products/database

    Trial Softwarewww.mathworks.com/trialrequest

    Saleswww.mathworks.com/contactsales

    Technical Supportwww.mathworks.com/support

    Using the Database Explorer App

    The Database Explorer app enables you to explore and exchange data with relational databases without any priorknowledge of SQL.

    You can use the Database Explorer app to set up and manage connections to multiple databases within MATLAB.You can:

    Select tables and columns, and create queries to import filtered data into MATLAB Save these queries as SQL scripts for future reference and execution Generate MATLAB code to replicate particular workflows that connect to data sources and run queries

    Using Database Explorer to extract data from multiple tables (bottom) and import this data into MATLAB as an arrayvariable (top).

    Resources

    Online User Communitywww.mathworks.com/matlabcentral

    Training Serviceswww.mathworks.com/training

    Third-Party Products and Serviceswww.mathworks.com/connections

    Worldwide Contactswww.mathworks.com/contact

    2013 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarksfor a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. 4

    Database ToolboxExchange data with relational databasesKey FeaturesImporting Data into MATLABUsing Scripts and Stored ProceduresWorking with Multiple DatabasesImporting Large Data SetsNative ODBC Driver

    Exporting Data to a DatabaseTransacting with Supported Databases

    Using the Database Explorer AppResources