MATLAB DATABASE TOOLBOX RELEASE NOTES Guida Utente Pagina 455

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 684
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 454
columns
7-25
'productNumber' 'Quantity' 'Price' 'inventoryDate'
Close the database connection.
close(conn)
Retrieve the Column List for a Catalog, Schema, and Table Name Using the Database Metadata
Object
Create a database connection conn. This code uses database name dbname, user name
username, password pwd, database server name sname, and port number 123456 to
connect to a Microsoft SQL Server database.
conn = database('dbname','username','pwd',...
'Vendor','Microsoft SQL Server',...
'Server','sname',...
'portnumber',123456);
Create the database metadata object dbmeta.
dbmeta = dmd(conn);
Retrieve the column names in a database table. Here, this code assumes that the
database contains the catalog name toy_store, the schema name schema, and the table
name inventoryTable.
columnlist = columns(dbmeta,'toy_store','schema','inventoryTable')
columnlist =
'productNumber' 'Quantity' 'Price' 'inventoryDate'
columns returns a cell array with the column names as strings.
Close the database connection.
close(conn)
Input Arguments
conn — Database connection
database connection object
Vedere la pagina 454
1 2 ... 450 451 452 453 454 455 456 457 458 459 460 ... 683 684

Commenti su questo manuale

Nessun commento