groovy array remove the brackets

前端 未结 2 1600
忘了有多久
忘了有多久 2021-01-17 06:39
  def colarray=[]
                    def num
                    def newRole = rolecol.split(\',\')
                    def len = newRole.size()
                            


        
2条回答
  •  时光说笑
    2021-01-17 07:14

    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,""])
    

提交回复
热议问题