Through a for loop with R language, I'm trying to use an insert statement to save rows in a table: One row example looks like this :
NUMPAT NAME FIRSTNAM BIRTHDATE SEX DATPREL ADICAP1 IDPAT NUMERORUM
1 ELOSTE JAMES 2003-09-27 1 2008-03-24 BHOTE4P1 468 2
What i've tried to write is:
info<- paste("INSERT INTO tab_anapath_std1 VALUES (",matOp[i,1],", \",matOp[i,2],\",\",matOp[i,3], \",",matOp[i,4],",",matOp[i,5],",",matOp[i,6],",\",matOp[i,7],\",",matOp[i,8],",",matOp[i,9],")")
sql_update_tbl_ds <- fn$dbSendQuery(dbconn, info)
And the output I got is :
NUMPAT NAME FIRSTNAM BIRTHDATE SEX DATPREL ADICAP1 IDPAT NUMERORUM
1 ,matOp[i,2], ,matOp[i,3], 0000-00-00 1 0000-00-00 ,matOp[i,7], 468 2
I have a real problem to manage the quotes ; i've even tried to change without success; How may I write it please ?