Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tried to fetch only DB value using groovy script but result includes the value along with header.
C#
def res = con.rows("select fkuserid from tblUserCardDetail where cardValue='111633072'" )
log.info "The User ID from DB is :" + res

Result is coming like this : Mon Apr 25 06:51:07 PDT 2016:INFO:The User ID from DB is :[[fkuserid:2951]]

I want only value : 2951

What I have tried:

def (value1, value2) = res.split(':')

I tried to split the result but error comes :

No signature of method: java.util.ArrayList.split() is applicable for argument types: (java.lang.String) values: [:] Possible solutions: split(groovy.lang.Closure), split(groovy.lang.Closure), wait(), sort(), asList(), toList()
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900