Learn R Programming

RMySQL (version 0.2-3)

getRowCount: Get the Number of Rows in a resultSet

Description

This gets the number of rows in a resultSet. Gives 0 if no row has been fetched.

Usage

getRowCount(object)

Arguments

object
object of class MySQLResultSet

Value

  • Integer of length one

References

http://www.mysql.com/

See Also

dbConnect, getDatabases

Examples

Run this code
m <- MySQL()
con <- dbConnect(m, user = "nobody", dbname = "test")
rs <- dbExecStatement(con, "SHOW TABLES")
getRowCount(rs)
fetch(rs, n = -1)
getRowCount(rs)
close(rs)
close(con)

Run the code above in your browser using DataLab