MATLAB DATABASE TOOLBOX RELEASE NOTES Guía de usuario Pagina 597

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 684
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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','','');
Vista de pagina 596
1 2 ... 592 593 594 595 596 597 598 599 600 601 602 ... 683 684

Comentarios a estos manuales

Sin comentarios