MATLAB DATABASE TOOLBOX RELEASE NOTES Betriebsanweisung Seite 578

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 684
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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);
Seitenansicht 577
1 2 ... 573 574 575 576 577 578 579 580 581 582 583 ... 683 684

Kommentare zu diesen Handbüchern

Keine Kommentare