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

  • 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 627
7 Functions — Alphabetical List
7-198
rows
Return number of rows in fetched data set
Syntax
numrows = rows(curs)
Description
numrows = rows(curs) returns the number of rows in the fetched data set curs.
Examples
Return the Number of Rows in the Cursor
After executing an SQL statement, return the number of rows in the database cursor
object generated by fetch.
Establish connection conn to a MySQL database with user name username and
password pwd.
conn = database('MySQL','username','pwd');
Execute a SELECT query on the productTable for product numbers 1 through 5
inclusive.
curs = exec(conn,['select * from productTable'...
' where productNumber >= 1 and productNumber <= 5']);
exec returns the database cursor object curs.
Fetch the data in curs.
curs = fetch(curs);
The Data property of curs contains the fetched data from the SELECT query.
Vue de la page 627
1 2 ... 623 624 625 626 627 628 629 630 631 632 633 ... 683 684

Commentaires sur ces manuels

Pas de commentaire