groovy array remove the brackets

自闭症网瘾萝莉.ら 提交于 2019-12-01 14:52:57

the [] are there, because you are doing an implicit toString on the list. use colarray.join(',')

def colarray = rolecol.tokenize(',').collect { "col$it" }.join(', ')

Then you will also need to escape your sql:

sql.eachRow("select col01, ${Sql.expand(colarray)} from read_csv where col01 = ? and ${Sql.expand('col' + usercol)} != ? ", [file.name,""])
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!