Ask a Question

How to use property value in sq with groovy?

SOLVED
_ivanovich_
Frequent Contributor

How to use property value in sq with groovy?

Hi,

i have a request with a response.

i transfered a value from the response using Property Transfer into Projetc Properties.

Now i want to use the value from the project property in my sql request:

I tried this:

StringBuilder builder = new StringBuilder()
sql.eachRow("select * from Person where PER_ID = '${#Project#Reqid-received}' ") { row ->
builder.append( "${row.per_id}," ) 
}

it doesn't work for me.

Is the request correct?

Thank you

 

1 REPLY 1
_ivanovich_
Frequent Contributor

I found it, it should be:

 

def per_id = context.expand('${#Project#Reqid-received}'')

Then us it in sql like:

sql.eachRow("select * from Person where PER_ID = "+re_id+" ")

 

It works. 

cancel
Showing results for 
Search instead for 
Did you mean: