Update XML-Groovy.xml.groovy

Answered

I am trying to update XML-Groovy.xml.groovy to fit my needs. The row separator should be the table name instead of <row>.

I changed line 73 from

printRow(0, "row", values)

to

printRow(0, TABLE, values)

but this results in <TableName: table>. I need just <TableName>, where "TableName" is the name of the table.

I found a way to achieve my goal:

String tableName = TABLE;
Integer len = tableName.length();
printRow(0, tableName.substring(0, len - 7), values)

This solution does not look very elegant. Is there a better way to achieve the same result?

0
2 comments

Hello Christoph!

TABLE.getName() // table name
TABLE.getParent().getName() // schema name

Example can be found in SQL-Insert-Statements.sql.groovy

0

Liudmila, that's it! Many thanks!

0

Please sign in to leave a comment.