MATLAB DATABASE TOOLBOX RELEASE NOTES Betriebsanweisung Seite 455

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 684
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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
Seitenansicht 454
1 2 ... 450 451 452 453 454 455 456 457 458 459 460 ... 683 684

Kommentare zu diesen Handbüchern

Keine Kommentare