Export data from mySQL to CSV

  1. Yeah just to clarify by variables this equates to SQL columns. A scalar return returns one item by it’s nature. If your TG to SQL is setup right then it’s better to “select * from db.table where datetime between startDate, EndDate” etc, then in Jython you handle the dataSet returned.

  2. It’s good practice to use named queries but the example I provided was rough and ready and doesn’t. You can copy the code above and paste into script console, and in 7.9 anyway it will output a file as is. I will run it on 8.0 next week and see if there are any changes required

  3. They are just examples, pseudo code, because I don’t know your data. If they were not commented out, then the script would fail to run. As per #1, now we know there are 30-40 columns then it’s irrelevant anyway