User`s guide
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.