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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 684
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 338
Saving Queries in Files
5-61
Saving Queries in Files
In this section...
“About Generated Files” on page 5-61
“VQB Query Elements in Generated Files” on page 5-62
“Saving Queries” on page 5-62
“Running Saved Queries” on page 5-62
“Editing Queries” on page 5-63
About Generated Files
Select Query > Generate MATLAB File to create a file that contains the equivalent
Database Toolbox functions required to run an existing query that was created in VQB.
Edit the file to include MATLAB or related toolbox functions, as needed. To run the
query, execute the file.
The following is an example of a file generated by VQB:
% Set preferences with setdbprefs.
s.DataReturnFormat = 'cellarray';
s.ErrorHandling = 'store';
s.NullNumberRead = 'NaN';
s.NullNumberWrite = 'NaN';
s.NullStringRead = 'null';
s.NullStringWrite = 'null';
s.JDBCDataSourceFile = '';
s.UseRegistryForSources = 'yes';
s.TempDirForRegistryOutput = '';
s.FetchInBatches = 'yes';
s.FetchBatchSize = '10000'
setdbprefs(s)
% Make connection to database. Note that the password has been omitted.
% Using ODBC driver.
conn = database('dbtoolboxdemo','','password');
% Read data from database.
e = exec(conn,'SELECT ALL StockNumber,January,February FROM salesVolume');
e = fetch(e);
close(e)
Close database connection.
close(conn)
Vista de pagina 338
1 2 ... 334 335 336 337 338 339 340 341 342 343 344 ... 683 684

Comentarios a estos manuales

Sin comentarios