How does one use the OraMetaData Object to describe tables?
Submitted by admin on Wed, 2005-11-09 23:38.
The OraMetaData object (available from Oracle8i) can be used to retrieve all
sorts of information about an Oracle schema. For example, one can list all
objects in a schema, all columns of a table, etc. Look at this simple ASP example:
Response.write("<H1>Describe Table EMP:</H1>")
Set objOraMetaData = OraDatabase.Describe("EMP")
Set objOraMDAttribute = objOraMetaData("ColumnList")
Set objColumnList = objOraMDAttribute.Value
For iColCount = 0 To objColumnList.Count - 1
Set objColumnDetails = objColumnList(iColCount).Value
Response.Write "<P>Column: " & objColumnDetails("Name") & _
" Type: " & objColumnDetails("DataType") & _
" Size: " & objColumnDetails("DataSize") & _
" IsNull: " & objColumnDetails("IsNull") & _
"Precision: " & objColumnDetails("Precision") & _
" Scale: " & objColumnDetails("Scale")
Next »
- Login to post comments

