title: How should I loop an INSERT INTO statement for SQL on R?
body: <pre><code>    query &lt;- paste0(&quot;INSERT INTO [MASTER] ([name], [code], [type]) VALUES(&quot;,
                     &quot;'&quot;,data$name,&quot;', &quot;, &quot;'&quot;,data$code,&quot;', &quot;,&quot;'&quot;,data$type,&quot;')&quot;)
  query_execute &lt;- DBI:dbGetQuery(conn = con, statement = query)
  </code></pre>
  <p>So I have a dataframe called data, with various values in name, code and type columns.</p>
  <p>How should I config my for loops so that it can go through from row 1 to the end and insert the data on each row separately?</p>
  <p>Asking as I can't just insert the entire dataframe using this method, I get</p>
  <pre><code> Error in new_result(connection@ptr, statement) : 
    Expecting a single string value: [type=character; extent=27].
  </code></pre>
  <p>Thanks!</p>