I was able to make a market basket analysis in r on the database.
I've finished my analysis and i want to write results into oracle database row by row. I've tried this
sonuclar<-inspect(basket_rules[1:5])
mode(sonuclar)
[1] "list"
class(sonuclar)
[1] "data.frame"
for(row in 1:nrow(sonuclar)) {`dbGetQuery(jdbcConnection,paste0("insert into market_basket_analysis (lhs,rhs,support,confidence,lift)
values ('",sonuclar$lhs[row],"','",sonuclar$rhs[row],"','",sonuclar$support[row],"','",sonuclar$confidence[row],"','",sonuclar$lift[row],"')"))}`
but it writes for only one row , it doesn't work for other loop iteration steps and it returns an error message :
`Error in .verify.JDBC.result(md, "Unable to retrieve JDBC result set meta data for ", :
Unable to retrieve JDBC result set meta data for insert into market_basket_analysis (lhs,rhs,support,confidence,lift) values ('{SPRITE GAZOZ1,5L}','{COCACOLA # 1,5LT}','0.00395004588437138','0.439024390243902','1.99010097534508') in dbSendQuery (ORA-00900: invalid SQL statement
)`
even though it gives an error , it inserted
{SPRITE GAZOZ1,5L},{COCACOLA # 1,5LT},'0.00395043993535644','0.439024390243902','1.98990246549237'
this is the first row.
I have not found meaningful information in the internet although i have searched a lot for over a week ; have any idea to solution about this error. Thanks in advance.