MATLAB DATABASE TOOLBOX RELEASE NOTES Uživatelská příručka Strana 658

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 684
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 657
7 Functions — Alphabetical List
7-228
[24] [ NaN] [ 30] '2014-10-22 11:19...'
Close the connection.
close(conn)
Specify Error Handling Settings
Changing the error handling database preferences affects the display of errors in
MATLAB.
Specify the store format for the ErrorHandling preference.
setdbprefs('ErrorHandling','store')
With the ErrorHandling property set to store, errors generated by running database
or exec are stored in the Message field of the returned connection or cursor object.
Establish connection conn to a MySQL database with user name username and
password pwd. This database contains the table producttable with the column
productdescription.
conn = database('MySQL','username','pwd');
Fetch data from a closed cursor.
curs = exec(conn,'select productdescription from producttable');
close(curs)
curs = fetch(curs,3)
curs =
Attributes: []
Data: 0
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: 'select productdescription from producttable'
Message: 'Invalid fetch cursor.'
Type: 'Database Cursor Object'
ResultSet: 0
Cursor: 0
Statement: [1x1 sun.jdbc.odbc.JdbcOdbcStatement]
Fetch: [1x1 com.mathworks.toolbox.database.fetchTheData]
The error generated by this operation appears in the Message field.
Zobrazit stránku 657
1 2 ... 653 654 655 656 657 658 659 660 661 662 663 ... 683 684

Komentáře k této Příručce

Žádné komentáře