Ant SQL with reserved word as Column Name


(JS Bournival) #1

Hi, I’m calling the Ant SQL task, and passing it a .sql file.

def executeSQL(sqlFile, schemaName) {
logger.quiet “\t\tSQL : ${sqlFile.name}”

def pass = "${schemaName}_pass"
ant.sql(driver: 'oracle.jdbc.OracleDriver', 
      url: "jdbc:oracle:thin:@${config.db.host}:${config.db.port}:${config.db.sid}", 
      userid: config.db."$schemaName".user,
      password: project."$pass",
      encoding: 'UTF-8',
      onerror: 'abort',
      classpath: configurations.db.asPath) {
	fileset(file: sqlFile)
}

}

Unfortunately, in my SQL file there’s an insert in a table which has a column named VALUE (I know!).

Oracle doc says I should put the said column name inside double quotes. That seem to work fine, at least it’s not complaining about the syntax, but during execution, gradle stops and freeze at the exact moment it’s running my insert statement.

Thoughts?