Forum Discussion
M_McDonald
15 years agoSuper Contributor
I think (the Eviware folks can correct me if I am wrong) but the evaluation of property expansions work from the inside outward, so
[tt:2fwceowe]${="'" + ${Properties#theProperty} + "'"}[/tt:2fwceowe]
first evaluates to
[tt:2fwceowe]${="'" + b + "'"}[/tt:2fwceowe]
which now is interpreted single quotes surrounding a variable b, which does not exist in scope.
This works when the property contains a number since it would then be interpreted as a literal value and not a variable, eg:
[tt:2fwceowe]${="'" + 123 + "'"}[/tt:2fwceowe]
When I am trying to figure out this kind of problem I find it helpful to create a Groovy script step and wrap the stuff to be evaluated in a context.expand:
then execute the step to see the result.
[tt:2fwceowe]${="'" + ${Properties#theProperty} + "'"}[/tt:2fwceowe]
first evaluates to
[tt:2fwceowe]${="'" + b + "'"}[/tt:2fwceowe]
which now is interpreted single quotes surrounding a variable b, which does not exist in scope.
This works when the property contains a number since it would then be interpreted as a literal value and not a variable, eg:
[tt:2fwceowe]${="'" + 123 + "'"}[/tt:2fwceowe]
When I am trying to figure out this kind of problem I find it helpful to create a Groovy script step and wrap the stuff to be evaluated in a context.expand:
log.info context.expand('''
select *
from aTable
where column1 = '777'
and column2 = ${="'" + ${Properties#theProperty} + "'"}
''')
then execute the step to see the result.
Related Content
- 5 years agoComputingFroggy
- 13 years agogordillo_ramon