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

  • 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 596
insert
7-167
data_table =
productNumber stockNumber supplierNumber unitCost productDescription
------------- ----------- -------------- -------- ------------------
11 400565 1010 10 'Rubik's Cube'
Insert the table data into productTable.
tablename = 'productTable';
insert(conn,tablename,colnames,data_table)
Display the data from productTable again.
curs = exec(conn,'select * from productTable');
curs = fetch(curs);
curs.Data
ans =
productNumber stockNumber supplierNumber unitCost productDescription
------------- ----------- -------------- -------- ------------------
9 125970 1003 13 'Victorian Doll'
8 212569 1001 5 'Train Set'
7 389123 1007 16 'Engine Kit'
2 400314 1002 9 'Painting Set'
4 400339 1008 21 'Space Cruiser'
1 400345 1001 14 'Building Blocks'
5 400455 1005 3 'Tin Soldier'
6 400876 1004 8 'Sail Boat'
3 400999 1009 17 'Slinky'
10 888652 1006 24 'Teddy Bear'
11 400565 1010 10 'Rubik's Cube'
A new row appears in productTable with the data from data_table.
After finishing with the cursor object, close it.
close(curs)
Close the database connection.
close(conn)
Insert the Contents of a Cell Array
Create a database connection conn using the dbtoolboxdemo data source. This
data source identifies a Microsoft Access database. This database contains the table
yearlySales that contains these columns: Month, salesTotal, and Revenue.
conn = database('dbtoolboxdemo','','');
Vue de la page 596
1 2 ... 592 593 594 595 596 597 598 599 600 601 602 ... 683 684

Commentaires sur ces manuels

Pas de commentaire