Learn R Programming

ora (version 2.0-1)

desc: Describe Oracle Table

Description

Show the column names of an Oracle table (or view) and various column properties, not unlike the Oracle SQL*Plus DESC command. Also show the number of rows when the table was last analyzed.

Usage

desc(table, tolower=TRUE, dots=FALSE, ...)

Arguments

table
Oracle table name, often in the owner.table format.
tolower
whether output table strings should be lowercased.
dots
whether underscores in column names should be replaced with dots, converting col_name to col.name.
...
passed to dbConnect.

Value

A data frame with named rows and the following columns:
name
Oracle column name.
Sclass
storage mode in R.
type
Oracle type.
len
Oracle length.
precision
Oracle precision.
scale
Oracle scale.
isVarLength
whether the variable has varying length in Oracle.
nullOK
whether the variable can be null.
Furthermore, the data frame contains two attributes: rows (the number of rows when the table was last analyzed) and analyzed (when the table was last analyzed). These attributes are not available for all Oracle tables, but are more likely to be available when the main argument table has the full owner.table format.

Details

The ... argument can be used to set username, password, and/or dbname (see dbConnect). Abbrevations like user and pass are allowed. The default database name is determined by the environment variable ORACLE_SID, which can be redefined within an R session using Sys.setenv(ORACLE_SID="foo").

See Also

desc is to Oracle tables as ll (in package gdata) is to R data frames.

ora gives an overview of the package.

Examples

Run this code
## Not run: 
# 
# desc("dual", tolower=FALSE)
# 
# desc("all_users")
# ## End(Not run)

Run the code above in your browser using DataLab