MATLAB DATABASE TOOLBOX RELEASE NOTES Podręcznik Użytkownika Strona 677

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 684
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 676
update
7-247
ans =
[ 1] [ 1700] [14.5000] '2014-10-20 00:00...'
[ 2] [ 1200] [ 9.3000] '2014-10-20 00:00...'
[ 3] [ 356] [17.2000] '2014-10-20 00:00...'
...
Define a cell array for the new price of the first product.
data(1,1) = {30.00};
Define the WHERE clause for the first product.
whereclause = 'where productNumber = 1';
Update the Price column in the inventoryTable for the first product.
tablename = 'inventoryTable';
colname = {'Price'};
update(conn,tablename,colname,data,whereclause)
Display the data in the inventoryTable table after making the update.
curs = exec(conn,'select * from inventoryTable');
curs = fetch(curs);
curs.Data
ans =
[ 1] [ 1700] [ 30] '2014-10-20 00:00...'
[ 2] [ 1200] [ 9.3000] '2014-10-20 00:00...'
[ 3] [ 356] [17.2000] '2014-10-20 00:00...'
...
The first product has an updated price of 30. Though the data is updated, the change has
not committed to the database.
Roll back the update.
rollback(conn)
Display the data in the inventoryTable table after rolling back the update.
curs = exec(conn,'select * from inventoryTable');
Przeglądanie stron 676

Komentarze do niniejszej Instrukcji

Brak uwag