Learn R Programming

RMySQL (version 0.4-6)

getNumRows: Get number of rows/columns of an SQL table

Description

Get the number of rows or columns of a remote SQL table

Usage

getNumCols(con, name, ...)
getNumRows(con, name, ...)

Arguments

con
a dbConnection object.
name
a character string specifying the name of the table on the remote RDBMS
...
any additional arguments are passed to the implementing method.

Value

  • an integer specifying the number of rows or columns.

Side Effects

Depending on the driver, a new connection or a new cursor (result set) will be opened for communicating with the RDBMS. Therefore, drivers that allow only one connection or one result set need to verify that the connection specified as the first argument does not have any pending work.

See Also

getTable assignTable removeTable existsTable

Examples

Run this code
con <- dbConnect("Oracle", group = "opto")
getNumRows(con, "WAVELENGTH")
[1] 118336

Run the code above in your browser using DataLab