pub.db.execSQL with LIKE clause


Any one can tell me how to put LIKE clause in pub.db.execSQL. for example 'select * from Employee where LastName LIKE ‘%lastName%’,
here lastName is a variable.

I tried ‘%%lastNanme%%’, and checked ‘perform variable substitution’.
It doesn’t work.


Hi Shuren,

You can do it the following way…

a map step which invokes multiConcat service as transformer from PSUtilities pacakge and concatenates three things ‘%’ as first string, lastName as second string and ‘%’ as thrid string. Map the output to some temp variabale and instead of lastName in your query use %temp%


Hi Shuren,

Simple way is here to execute any query by wmDb or Oracle.

Just set your query in a variable, like you should write your query like:
select * from tar where facilityname like ‘%lastName%’ and and checked ‘perform variable substitution’.

But you need to make sure that your variable must have value in pipeline.

And map your query & dbalias name with execSQL.

I believe, it will help.