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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 684
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 575
7 Functions — Alphabetical List
7-146
conn = database.ODBCConnection('MySQL','username','pwd');
Select all products from the productTable table and sort them in ascending order
by product number. Create a scrollable cursor using the name-value pair argument
'cursorType'.
curs = exec(conn,'select * from productTable order by productNumber',...
'cursorType','scrollable');
Import the data for two products in the middle of the data set. Use the row limit 2 to
import data for two products. Use the absolute position offset 3 to import data starting
from the third product in the data set.
curs = fetch(curs,2,'absolutePosition',3);
Display the data for the two products.
curs.Data
ans =
[3] [400999] [1009] [17] 'Slinky'
[4] [400339] [1008] [21] 'Space Cruiser'
The columns in curs.Data are:
Product number
Stock number
Supplier number
Unit cost
Product description
Display the position of the cursor.
curs.Position
ans =
3
The position of the cursor stays at the absolute position offset 3.
After finishing with the cursor object, close it.
Przeglądanie stron 575
1 2 ... 571 572 573 574 575 576 577 578 579 580 581 ... 683 684

Komentarze do niniejszej Instrukcji

Brak uwag