Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

condition

Former Member
0 Likes
405

HI All

I have a variable v1 = 'ztest'

and I have objid field values as 'ztest1', 'ztest2', 'ztest3', 'ztest'

I need to give a select command with a condition as follows

select count ( * ) into cnt from table where objid = v1.

It is giving the count value as 4 . But I want the exact match that is it has to consider only 'ztest' and not 'ztest1','ztest2' etc.

What should I do for this.

Regards

renuka.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
377

Try this way


  concatenate v1 '%' into v1.
  condense v1 no-gaps.
  select count ( * ) into cnt from table where objid like v1.

a®

1 REPLY 1
Read only

former_member194669
Active Contributor
0 Likes
378

Try this way


  concatenate v1 '%' into v1.
  condense v1 no-gaps.
  select count ( * ) into cnt from table where objid like v1.

a®