×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




What are you trying to do? LOCATE and LIKE are not going to do the same things. LOCATE is a built-in function that returns the first position that a search string occurs in another string. LIKE is a predicate for comparing values.

I can't see where they can be used for the same purpose - please explain.

Now there is a problem in your code, I think - what is Class.snapshotpath? Is it an element of a data structure? If so, you can't use it to concatenate with the SQL concatenation - you have to use RPG concatenation.

Because Class.snapshotpath does not look like an SQL column name.

HTH
Vern

On 6/25/2012 3:37 PM, Naveen Kapoor wrote:
Hello All,

I have a situation where i have to passin a parameter from a program and in
the called program I have to use it with IN predicate.

I read that its not possible so tried it with like statement, but I wanted
to do with LOCATE keyword, do any one have any idea on how to do this.

(Case
When :parmSnapShPath <>' '
then :parmSnapShPath
else '%' || trim(Class.snapshotpath) || '%'
end ) like '%' || trim(Class.snapshotpath) || '%'

Where parmSnapSHPath is having more than one values like
('A','B','C'......)




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.