Oracle Objects for OLE
Release 9.2

Part Number A95895-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

Example: Describing Unknown Schema Objects

See OraMetaData Schema Definitions.

Sub RecursiveDescribe(name$, xMD As OraMetaData)

Dim xMDAttr As OraMDAttribute

For I = 0 To xMD.Count - 1

Set xMDAttr = xMD.Attribute(I)

' If an attribute can be described further, describe it,

' otherwise display its attribute name & value

If (xMDAttr.IsMDObject) Then

RecursiveDescribe xMDAttr.name, xMDAttr.Value

Else

MsgBox name & "->" & xMDAttr.name & " = " & xMDAttr.Value

End If

Next I

End Sub

Sub Main()

'This example displays all the attributes of any schema object given

Dim OraSession As OraSession

Dim OraDatabase As OraDatabase

Dim OraDynaset As OraDynaset

Dim xMD As OraMetaData

Dim x As String

'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&)

' x is any database object, here the EMP table is used as an example

x = "EMP"

Set xMD = OraDatabase.Describe(x)

MsgBox x & " is of the type " & xMD.Type

RecursiveDescribe x, xMD

End Sub


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback