contentsData(file=NULL, type="", odbcConnection="", server="", user="", password="", database="")
type
argument below), S-PLUS
assumes the file is of that type. This can be overridden by providing
type
explicitly. The
file
argument is not required if the data source is a
relational database.
type="ODBC"
and is functional only in
S-PLUS for Windows.
type="DIRECT-SQL"
, and you are accessing a non-default instance of SQL
Server, specify
server="SERVERNAME\\INSTANCE"
. To access the default instance, use
server=
"SERVERNAME"
.This should be left as the empty string
""
if
type="DB2"
.
type="ORACLE"
and you are
using Remote OS Authentication, specify
password="self"
and
no
user
argument.
""
if
type="ORACLE"
.
NULL
if the data file is not a type that can contain multiple data sets.
If the data source is a type of file that can contain multiple data sets (or
sheets), then the returned value is a vector of the names of all the data sets in the file.
Currently, the types of files that can contain more than one data set are:
Microsoft Excel worksheet files, SAS transport files, and Microsoft
Access files (Windows only).
If the data source is a relational database, then this function returns the
names of all tables.
For a complete list of possible types see the
type
argument of the
function.
# Only one data set can be exported to Excel exportData(fuel.frame,"fuel.xls", type="EXCEL") # expect to get "fuel" contentsData("fuel.xls", type="EXCEL")
# If the SAS transport file contains 3 data sets, # expect to get: "GLUCOSE" "IMPGLUC" "SINDEX" contentsData("glucose_xport.tpt", type="SAS_TPT")
# Get the names of all tables in the Oracle server "ORACLEDB" contentsData(type="oracle", user="scott", password="tiger", server="ORACLEDB")