R: Request Information about Data Types in an ODBC Database
sqlTypeInfo
R Documentation
Request Information about Data Types in an ODBC Database
Description
Request information about data types in an ODBC database
Usage
sqlTypeInfo(channel, type = "all", errors = TRUE, as.is = TRUE)
Arguments
channel
connection handle as returned by odbcConnect.
type
The types of columns about which information is requested.
Possible values are "all", "char", "varchar" ,
"wchar", "wvarchar" (Unicode), "real",
"float", "double", "integer",
"smallint", "date", "time",
"timestamp", "binary", "varbinary",
"longvarbinary" and (its alias) "blob".
errors
logical: if true halt and display error, else return -1.
as.is
as in sqlGetResults.
Details
sqlTypeInfo attempts to find the types of columns the database
supports: ODBC drivers are not required to support this (but all known
examples do). Where it is supported, it is used by
sqlSave to decide what column types to create when
creating a new table in the database.
Value
A data frame on success, or character/numeric on error depending on
the errors argument. Use sqlGetResults for
further details of errors.
The columns returned may depend on the ODBC driver manager. For a
fully ODBC 3 manager, see
http://msdn.microsoft.com/en-us/library/ms714632(VS.85).aspx:
the symbolic constants mentioned there will be returned as numbers
(and the values of the numeric constants can be found in the ODBC
headers such as ‘sql.h’ and ‘sqlext.h’).