def colarray=[]
def num
def newRole = rolecol.split(',')
def len = newRole.size()
println "$newRole,$len"
for (num = 0; num < len; num++) {
def col = "col"
col="$col"+newRole[num]
colarray.add(col)
}
println colarray
sql.eachRow("select col01,$colarray from read_csv where col01=? and col${usercol}!=? ", [file.name,""])
我想保存col1..col11到數組,並從select語句調用它,但問題是,$ colarray有它的括號(如[col03,col04,col05,col06, col0,col10,col09,col10,col11,col12,col13,col14,col15,col16,col17,col18,col19,col20,col21,col22,col23,col24,col25,col26,col27,col28,col29,col30,col31,所以現在我想刪除它們,任何人都可以幫助它??? thx常規陣列中的括號去掉
感謝會嘗試 – 2015-01-21 10:10:54
高清AA = colarray.join( '') 的println AA // sql.eachRow( 「選擇COL01,從read_csv其中COL01 =?和col $ {} usercol!=?$ AA」,[file.name 「」]) 您好我編輯它這樣,但得到錯誤,請查看下面的註釋 – 2015-01-21 10:14:22