Learn R Programming

RMySQL (version 0.4-6)

describe: Describe an object through its meta-data

Description

Prints a concise description of the meta-data associated with an object

Usage

describe(obj, verbose, ...)

Arguments

obj
any object that implements some functionality under the R/S interface to databases, e.g., dbManager, dbConnection, dbResultSet, resultSet.
verbose
a logical controling the amount of output.
...
any other argument that the individual methods may take.

Value

  • NULL

Side Effects

This function is used mainly for its printing side effects.

References

See the Omega Project for Statistical Computing at http://www.omegahat.org for more details on the R/S database interface.

See Also

On database managers:

dbManager MySQL load unload

On connections, SQL statements and resultSets:

dbExecStatement dbExec fetch quickSQL

On transaction management:

commit rollback Ora On meta-data:

describe getVersion getDatabases getTables getFields getCurrentDatabase getTableIndices getException getStatement hasCompleted getRowCount getAffectedRows getNullOk getInfo

Examples

Run this code
> m <- dbManager("Oracle")
> ...
# Let's look at the status of the manager

> describe(m, verbose = F)   
OraManager id = (7269) 
  Max  connections: 16 
  Conn. processed: 1 
  Default records per fetch: 500 
  Open connections: 1 

> rs <- dbExecStatement(con, query)
> ...

# The following shows that we extracted only one field
# names "Tables in opto" plus its corresponding S class, internal 
# database type, and various other internal attributes.

> getFields(rs)
           name    Sclass              type len precision scale nullOK 
1 Tables in opto character FIELD_TYPE_STRING  64        64     0      F

# A full description of the result set is

> describe(rs, verbose = T)
OraResultSet id = (7269,3,1) 
  Statement: show tables 
  Has completed? no 
  Affected rows: -1 
  Rows fetched: 3 
  Fields:
            name    Sclass              type len precision scale nullOK 
1 Tables in opto character FIELD_TYPE_STRING  64        64     0      F

Run the code above in your browser using DataLab