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

  • 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 439
7 Functions — Alphabetical List
7-10
dbds = datastore(conn,sqlquery);
Close the DatabaseDatastore object dbds.
close(dbds)
Close the Cursor Object
Using the native ODBC interface, connect to the database with the ODBC data source
name dbtoolboxdemo with the user name admin and password admin.
conn = database.ODBCConnection('dbtoolboxdemo','admin','admin');
Select data from productTable that you access using the database.ODBCConnection
object conn. Assign the returned cursor object to the variable curs.
sqlquery = 'select * from productTable';
curs = exec(conn,sqlquery);
Close the cursor object curs before closing the database connection.
close(curs)
Close the database connection conn.
close(conn)
Close the Resultset Object
Connect to the database with the ODBC data source name dbtoolboxdemo with the
user name admin and password admin.
conn = database('dbtoolboxdemo','admin','admin');
Select data from productTable that you access using the database connection object
conn. Assign the returned cursor object to the variable curs.
sqlquery = 'select * from productTable';
curs = exec(conn,sqlquery);
Construct a resultset object rset.
rset = resultset(curs);
Close the resultset object rset.
Vue de la page 439
1 2 ... 435 436 437 438 439 440 441 442 443 444 445 ... 683 684

Commentaires sur ces manuels

Pas de commentaire