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

  • 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 555
7 Functions — Alphabetical List
7-126
supplierNumber
unitCost
productDescription
conn = database.ODBCConnection('dbtoolboxdemo','admin','admin')
conn =
ODBCConnection with properties:
Instance: 'dbtoolboxdemo'
UserName: 'admin'
Message: []
Handle: [1x1 database.internal.ODBCConnectHandle]
TimeOut: 0
AutoCommit: 0
Type: 'ODBCConnection Object'
conn has an empty Message property, which means a successful connection.
Select and display the data from the productTable.
curs = exec(conn,'select * from productTable');
curs = fetch(curs);
curs.Data
ans =
productNumber stockNumber supplierNumber unitCost productDescription
------------- ----------- -------------- -------- ------------------
...
6 400876 1004 8 'Sail Boat'
3 400999 1009 17 'Slinky'
10 888652 1006 24 'Teddy Bear'
Store the column names of productTable in a cell array.
tablename = 'productTable';
colnames = {'productNumber','stockNumber','supplierNumber',...
'unitCost','productDescription'};
Store the data for the insert in the cell array data that contains these values:
productNumber equal to 11
stockNumber equal to 500565
supplierNumber equal to 1010
Vue de la page 555
1 2 ... 551 552 553 554 555 556 557 558 559 560 561 ... 683 684

Commentaires sur ces manuels

Pas de commentaire