addid <- function(matrix,channel){ table <- "marketing_mini_temp"; print(sqlQuery ( channel, paste("delete from ",table,";") )); sqlString <- paste("insert into ",table," values ("); for(id in 1:dim(matrix)[1] ){ print(paste("id:" ,id,"columns:",dim(matrix)[2])); matrix[id,dim(matrix)[2]] = id; sqlRow <- sqlString; for (stlp in 1:dim(matrix)[2]){ sqlRow <- paste(sqlRow,"'",matrix[id,stlp],"',",sep=""); } sqlRow <- paste( substring(sqlRow,1,nchar(sqlRow)-1),");",sep=""); print(sqlRow); print(sqlQuery ( channel, sqlRow )); } #return ( matrix); }