# NOT RUN {
## example results from MySQL
> channel <- odbcConnect("test")
> sqlDrop(channel, "USArrests", errors = FALSE) # precautionary
> sqlSave(channel, USArrests, addPK = TRUE)
> sqlColumns(channel, "USArrests")
TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME
1 ripley <NA> USArrests rownames 12 varchar
2 ripley <NA> USArrests Murder 8 double
3 ripley <NA> USArrests Assault 4 integer
4 ripley <NA> USArrests UrbanPop 4 integer
5 ripley <NA> USArrests Rape 8 double
... 12 more columns
> sqlColumns(channel, "USArrests", special = TRUE)
SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH
1 2 rownames 12 varchar 255 255
DECIMAL_DIGITS PSEUDO_COLUMN
1 NA 1
> sqlPrimaryKeys(channel, "USArrests")
TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME KEY_SEQ PK_NAME
1 <NA> <NA> USArrests rownames 1 PRIMARY
> sqlDrop(channel, "USArrests")
> close(channel)
# }
Run the code above in your browser using DataLab