export numerical data with quotes from VARCHAR columns


I was using the multi-values clause example found here


But it looks like this (and the included SQL-Insert-Statements.sql.groovy file) use this code to determine if a column should be quoted 

def skipQuote = value.toString().isNumber() || value == null

The problem with this code is when there are character columns (like VARCHAR) that contain numeric data (like zip codes) but they need to be stored as strings to keep preceding zeros.  The resulting value in the clause lacks the needed quotes.

Is there a way to determine the source column type and do the quoting via that vs the actual value?

1 comment
Comment actions Permalink


You can extend and modify SQL-Insert-Statements.sql.groovy as you need. Furthermore you can write your own extractor.


Please sign in to leave a comment.