MATLAB DATABASE TOOLBOX RELEASE NOTES Guía de usuario Pagina 500

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 684
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 499
7 Functions — Alphabetical List
7-70
preview
Display first eight records of data in DatabaseDatastore
Syntax
data = preview(dbds)
Description
data = preview(dbds) displays the first eight records of data in the
DatabaseDatastore object dbds.
Examples
Preview Data in a DatabaseDatastore
The default output data type of any datastore is a table. Set the database preference
for the data return format 'DataReturnFormat' to table for consistency across data
types.
setdbprefs('DataReturnFormat','table')
Create a database connection conn using the native ODBC interface. This code assumes
you are connecting to a MySQL database with the data source named MySQL, user name
username, and password pwd. MySQL contains the table named productTable with 15
product records.
conn = database.ODBCConnection('MySQL','username','pwd');
Create a DatabaseDatastore object dbds using the database connection conn and
SQL query sqlquery. This SQL query retrieves all products from the product table
productTable ordered by product number.
sqlquery = 'select * from productTable order by productNumber';
dbds = datastore(conn,sqlquery);
Vista de pagina 499
1 2 ... 495 496 497 498 499 500 501 502 503 504 505 ... 683 684

Comentarios a estos manuales

Sin comentarios