MATLAB DATABASE TOOLBOX RELEASE NOTES Guía de usuario Pagina 659

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 684
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 658
setdbprefs
7-229
Specify the report format for the ErrorHandling preference.
setdbprefs('ErrorHandling','report')
With the ErrorHandling property set to report, errors generated by running
database or exec appear immediately in the Command Window.
Fetch data from a closed cursor.
curs = exec(conn,'select productdescription from producttable');
close(curs)
curs = fetch(curs,3);
Error using cursor/fetch>errorhandling (line 491)
Invalid fetch cursor.
Error in cursor/fetch (line 460)
errorhandling(outCursor.Message);
The error generated by this operation appears immediately in the Command Window.
Specify the empty format for the ErrorHandling preference.
setdbprefs('ErrorHandling','empty')
With the ErrorHandling property set to empty, errors generated while running
database or exec are stored in the Message field of the returned connection or cursor
object. In addition, objects that cannot be created are returned as empty handles, [].
Fetch data from a cursor from an invalid table invalidTable.
curs = exec(conn, 'select * from invalidTable')
curs = fetch(curs)
curs =
Attributes: []
Data: []
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: 'select * from invalidTable'
Message: [1x102 char]
Type: 'Database Cursor Object'
ResultSet: 0
Cursor: 0
Vista de pagina 658
1 2 ... 654 655 656 657 658 659 660 661 662 663 664 ... 683 684

Comentarios a estos manuales

Sin comentarios