MATLAB DATABASE TOOLBOX RELEASE NOTES Guide de l'utilisateur Page 578

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 684
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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);
Vue de la page 577
1 2 ... 573 574 575 576 577 578 579 580 581 582 583 ... 683 684

Commentaires sur ces manuels

Pas de commentaire