title: Insert into SQL with Groovy using variable for values
body: <p>I'm trying to use a variable for the values part of an insert SQL statement. What's odd is that if I copy the values of what I see in the debugger then the statement runs and inserts correctly. If I use the variable then it gives me a <strong>"Sorry, wrong number of values"</strong> error. </p>
  
  <p>Here's my insert</p>
  
  <pre><code>db.execute("""
          INSERT INTO TABLE 
          (UNIT, ORD#, DISP, DATE, TIME, AMT, LAT, LONG, DRVR, OWNR, SETT, STAT) 
          values ${parsedOrderNumbers}
          """)
  </code></pre>
  
  <p><code>parsedOrderNumbers</code> looks like in the debugger, but it might also have <code>" "</code> surrounding it since it's a String. I'm not sure and think that might be what is happening here with the error or maybe with how Groovy interpolates <code>${parsedOrderNumbers}</code></p>
  
  <pre><code>('12345', '1234567', '' ,'2020-04-11', '234', '35.00', '39.693702697753906', '-75.53226470947266', '', '', '', ''), ('20514', '9876543', '' ,'2020-04-12', '004', '24.00', '39.27902603149414', '-76.55120086669922', '', '', '', '') 
  </code></pre>
  
  <p>If I copy this and replace <code>${parsedOrderNumbers}</code> then the statement runs. Any ideas?</p>