MATLAB DATABASE TOOLBOX RELEASE NOTES Guida Utente Pagina 578

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 684
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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);
Vedere la pagina 577
1 2 ... 573 574 575 576 577 578 579 580 581 582 583 ... 683 684

Commenti su questo manuale

Nessun commento