Oracle Objects for OLE
Release 9.0.1

Part Number A90173-01


Book List


Master Index


Describing Database Schema Objects

The OraMetaData interface provides access to the schema information of database objects. It is returned by invoking the Describe method of the OraDatabase interface. The describe method takes the name of a schema object, such as the emp table, and returns an OraMetaData object. The OraMetaData object provides methods for dynamically navigating and accessing all the attributes (OraMDAttribute collection) of a schema object described.

The following VB script illustrates a simple use of the OraMetaData interface. The sample retrieves and displays several attributes of the emp table.

Dim empMD as OraMetaData

set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

set empDb = OO4OSession.OpenDatabase("ExampleDb", "scott/tiger", 0)

Add EMPNO as an Input parameter and set its initial value.

Set empMd = empDb.Describe("emp")

Get the column attribute collections.

Set empColumnsMd = empMd("ColumnList").Value

Display name, data type, and size of each column in the emp table.

For I = 0 To empColumnsMd.Count - 1

Set ColumnMd = empColumnsMd(I).Value

MsgBox ColumnMd("DataType").Value

MsgBox ColumnMd("Name").Value

Next I

Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.


Book List