Learn R Programming

PivotalR (version 0.1.18.5)

print-methods: Display the connection information associated with a db object

Description

This function displays the SQL table, database, host, and connection information associated with a db.table or db.view object.

Usage

# S4 method for db.data.frame
print(x)

# S4 method for db.Rquery print(x)

# S4 method for db.data.frame show(object)

# S4 method for db.Rquery show(object)

Arguments

x

The signature of the method. A db.data.frame (includes db.table and db.view) object, which points to a table or view in the database; or a db.Rquery object, which represents some operations on a db.data.frame object.

object

The signature of the method. A db.data.frame (includes db.table and db.view) object, which points to a table or view in the database; or a db.Rquery object, which represents some operations on a db.data.frame object.

Value

This function returns nothing.

Details

When the signature x is either a db.data.frame object or a db.Rquery object, this function displays the name of connected SQL database, the SQL database host, and the connection ID.

When the signature x is a db.data.frame object, the function also displays the associated table. When the signature x is a db.Rquery object, this function displays the temporary status of the input, and the table that it is derived from.

See Also

lk or lookat Displays the contents of an associated table.

Examples

Run this code
# NOT RUN {
<!-- %% @test .port Database port number -->
<!-- %% @test .dbname Database name -->
## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)

## create a table from the example data.frame "abalone"
x <- as.db.data.frame(abalone, conn.id = cid, verbose = FALSE)

## printing db.data.frame object
x # Display the associated table, and database information for x

db.disconnect(cid, verbose = FALSE)
# }

Run the code above in your browser using DataLab