|
What's wrong with this syntax = markupBuilder + SQL: msg#00111lang.groovy.user
import groovy.sql.*;
import groovy.xml.*; release = "3.11";
I'm trying to spit
out a td row for each line of my sql, but it complains about
closures.
sql =
Sql.newInstance("jdbc:mysql://mcaosdev2:3306/mantis_db",
"furashgf", "melissa", "org.gjt.mm.mysql.Driver"); getWorkloadSql = <<<EOS SELECT mut.last_name, mut.first_name, COUNT(*) AS total_tasks, SUM(IF(mbt.projection IS NULL OR mbt.projection = 10, 1,0)) AS unsized_tasks, SUM(mbp.value) AS workload FROM mantis_user_table AS mut LEFT OUTER JOIN mantis_bug_table AS mbt ON (mbt.handler_id = mut.id) LEFT OUTER JOIN mantis_project_version_table AS mpvt ON (mpvt.id = mbt.version_id) LEFT OUTER JOIN m_bug_status AS mbs ON (mbs.status_cd = mbt.status) LEFT OUTER JOIN m_bug_projection AS mbp ON (mbp.projection_cd = mbt.projection) WHERE mpvt.version = ${release} AND mbs.is_active_state = "Y" AND mut.role_cd IN ("DEV", "ADM") GROUP BY mut.last_name, mut.first_name ORDER BY mut.last_name, mut.first_name; EOS htmlOut = new MarkupBuilder();
htmlOut.html() { head() { title("Load By Developer for Release $release"); } body() { table() { tr() { th("Team Member"); th("Total Tasks"); th("Workload"); } sql.eachRow(getWorkloadSql) { tr() { td(it.last_name + ", " + it.first_name); td(it.total_tasks); td(it.workload); } } } } } println(htmlOut);
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Adressing inner java classes from Groovy: the return of the $-notation?, Joerg Plewe |
|---|---|
| Next by Date: | How to use markup builder as a big string, Furash Gary |
| Previous by Thread: | Adressing inner java classes from Groovy: the return of the $-notation?, Joerg Plewe |
| Next by Thread: | Re: What's wrong with this syntax = markupBuilder + SQL, Guillaume Laforge |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |