MATLAB DATABASE TOOLBOX RELEASE NOTES Guide de l'utilisateur Page 577

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 684
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 576
fetch
7-147
close(curs)
Import Data with Different Formats Using the Cursor Object
Import data that includes a BOOLEAN field, using the setdbprefs function to specify
cellarray as the format for the retrieved data.
curs = exec(conn,['select InvoiceNumber, '...
'Paid from Invoice']);
setdbprefs('DataReturnFormat','cellarray')
curs = fetch(curs,5);
A = curs.Data
A =
[ 2101] [0]
[ 3546] [1]
[33116] [1]
[34155] [0]
[34267] [1]
View the class of the second column of A.
class(A{1,2})
ans =
logical
After finishing with the cursor object, close it.
close(curs)
Import Data Using the Database Connection Object
fetch imports data from the specified SQL statement when you pass a database object,
conn, as the first argument. Use this example when using a JDBC/ODBC bridge or a
JDBC interface. For the native ODBC interface, use curs as the input argument.
Using the dbtoolboxdemo data source that you access using the database connection
object, conn, import the productDescription column from productTable. Set the
data return format to 'cellarray' using setdbprefs.
setdbprefs('DataReturnFormat','cellarray')
Vue de la page 576
1 2 ... 572 573 574 575 576 577 578 579 580 581 582 ... 683 684

Commentaires sur ces manuels

Pas de commentaire