sql - Batch / Bulk insert in R -
i trying batch insert in r using rjdbc. seems inserts 1 row @ time takes lot of time.
i wondering if knows of solution in r bulk insert data r sql. know rodbc can parametrized insert fast not fast bulk insert.
i don't know "r" language, there bulk sql statement available in sqlexe.
sqlexe utility connects sql databases via odbc , execute valid sql, plus has additional features ( http://sourceforge.net/projects/sqlexe/ )
for example, assuming target table is:
table: [mydata] ------------------- row_id char(1) row_idx integer row_desc char(32)
to insert task sqlexe prepare file input:
input.dat a,1,this row 1 b,2,this row 2 c,3,this row 3 d,4,this row 4
the command line import:
sql --dsn mydb -e "bulk insert input.dat, insert mydata(row_id,row_idx,row_desc) values(?,?,?)"
Comments
Post a Comment