In RStudio:
drv <- dbDriver("Oracle")
con <- dbConnect(drv, username ="user", password = "password", dbname="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=host)(Port=port))(CONNECT_DATA=(SERVICE_NAME=service_name)))")
df <-
read.csv(url("http://samplecsvs.s3.amazonaws.com/Sacramentorealestatetransactions.csv"))
dbWriteTable(con,"TEST",df)
*NB : Table name is case sensitive. if you use lowercase, you will have to access the table using double quotes (select * from "Test")
Created table description in SQLPlus
desc TEST
Name Null Type
--------- ---- --------------
street VARCHAR2(4000)
city VARCHAR2(4000)
zip NUMBER(38)
state VARCHAR2(4000)
beds NUMBER(38)
baths NUMBER(38)
sq__ft NUMBER(38)
type VARCHAR2(4000)
sale_date VARCHAR2(4000)
price NUMBER(38)
latitude NUMBER
longitude NUMBER
Comments
Post a Comment