cancel
Showing results for 
Search instead for 
Did you mean: 

How to use property value in sq with groovy?

SOLVED
Highlighted
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 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: How to use property value in sq with groovy?

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. 

View solution in original post

1 REPLY 1
Highlighted
Frequent Contributor

Re: How to use property value in sq with groovy?

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. 

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors