MATLAB DATABASE TOOLBOX RELEASE NOTES Uživatelská příručka Strana 652

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 684
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 651
7 Functions — Alphabetical List
7-222
Example 4 — Set the AutoCommit Flag to Off and Roll Back Data
This example runs update to insert data into a database whose AutoCommit flag is off.
It then uses rollback to roll back the data.
1
Set the AutoCommit flag to off for database connection conn.
set(conn, 'AutoCommit', 'off');
2
Update the data in colnames in the Avg_Freight_Weight table, for the record
selected by whereclause, with data from the cell array exdata.
update(conn, 'Avg_Freight_Weight', colnames, exdata,
whereclause)
3
Roll back the data.
rollback(conn)
The data in the table is now as it was before you ran update.
Example 5 — Set the LoginTimeout for a Drivermanager Object
1
Create a drivermanager object dm using drivermanager. Set the LoginTimeout
value to 3 seconds.
dm = drivermanager;
set(dm,'LoginTimeout',3);
2
Verify this result.
logintimeout
ans =
3
See Also
database | exec | fastinsert | fetch | get | logintimeout | update
Zobrazit stránku 651
1 2 ... 647 648 649 650 651 652 653 654 655 656 657 ... 683 684

Komentáře k této Příručce

Žádné komentáře