m <- dbManager(dbms)
# Extract meta-data information. What MySQL databases are there
# available on host "wyner"
> getDatabases(m, host = "wyner")
Database
1 mysql
2 opto
3 test
4 iptraffic
5 fraud
# What tables are there in the Oracle "opto" database?
> dbTables(m, dbname = "opto", host = "wyner")
Tables in opto
1 PBCT
2 PURGE
3 WL
4 liv25
5 liv85
# let's look at some result set meta-data
> con <- dbConnect(m)
> rs <- dbExecStatement(con, query.sql)
> getStatement(rs)
[1] "show tables"
> hasCompleted(rs)
[1] 0
> getRowCount(rs)
[1] 3
> info <- getInfo(rs)
> names(info)
[1] "statement" "isSelect" "rowsAffected"
[4] "rowCount" "completed" "fieldDescription"
> getStatement(rs)
[1] "show tables"
# the following are pieces of meta-data associated with
# the R/S DBI implementation, versions for the various pieces
# of software (client, server, interface), etc.
# dbManager object
> names(getInfo(m))
[1] "connectionIds" "fetch_default_rec"
[3] "managerId" "length"
[5] "num_con" "counter"
[7] "clientVersion"
# dbConnection object
> names(getInfo(con))
[1] "host" "user"
[3] "dbname" "conType"
[5] "serverVersion" "protocolVersion"
[7] "threadId" "rsId"
# resultSet object
> names(getInfo(rs))
[1] "statement" "isSelect"
[3] "rowsAffected" "rowCount"
[5] "completed" "fieldDescription"
Run the code above in your browser using DataLab