Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Example: Describing a User-Defined Type

See OraMetaData Schema Definitions.

Dim OraSession As OraSession

Dim OraDatabase As OraDatabase

Dim OraDynaset As OraDynaset

Dim OraMetaData As OraMetaData

Dim OraMDAttribute As OraMDAttribute

Dim attrList As OraMetaData

Dim attr As OraMetaData

'Create the OraSession Object.

Set OraSession = CreateObject("OracleInProcServer.XOraSession")

'Create the OraDatabase Object by opening a connection to Oracle.

Set OraDatabase = OraSession.OpenDatabase("ExampleDB", "scott/tiger",

0&)

Set OraMetaData = OraDatabase.Describe("ORAMD_ADDRESS")

NumAttributes = OraMetaData!NumAttributes

NumMethods = OraMetaData!NumMethods

MsgBox "The Address type has " & NumAttributes & " attributes"

MsgBox "Address Object has " & NumMethods & " methods"

'Retrieve the attribute list of this type object

Set attrList = OraMetaData!Attributes.Value

'Display the name and data type of each attribute

For I = 0 To attrList.Count - 1

Set attr = attrList(I).Value

' each attr is actually an OraMetaData

MsgBox "Attribute Name: " & attr!Name

MsgBox "Attribute Type: " & attr!TypeName

Next I