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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 684
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 577
7 Functions — Alphabetical List
7-148
sqlquery = 'select productdescription from productTable';
results = fetch(conn, sqlquery)
results =
'Victorian Doll'
'Train Set'
'Engine Kit'
'Painting Set'
'Space Cruiser'
'Building Blocks'
'Tin Soldier'
'Sail Boat'
'Slinky'
'Teddy Bear'
View the size of the cell array into which the results were returned.
size(results)
ans =
10 1
Close the database connection.
close(conn)
Import Data with fetchbatchsize Using the Database Connection Object
fetch imports data from the specified SQL statement when you pass a database object,
conn, as the first argument. Use this example when using a JDBC/ODBC bridge or a
JDBC interface. For the native ODBC interface, use curs as the input argument.
Using the dbtoolboxdemo data source that you access using the database connection
object, conn, import the productDescription column from the productTable by
using the fetchbatchsize argument.
setdbprefs('DataReturnFormat','cellarray')
sqlquery = 'select productdescription from productTable';
fetchbatchsize = 5;
results = fetch(conn,sqlquery,fetchbatchsize);
Przeglądanie stron 577
1 2 ... 573 574 575 576 577 578 579 580 581 582 583 ... 683 684

Komentarze do niniejszej Instrukcji

Brak uwag