Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
use of % in a VARCHAR string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Mon Oct 09, 2006 2:25 pm    Post subject: use of % in a VARCHAR string
Reply with quote

Hi All,

If I have a string as 'NEEL%SH' then how would I use the LIKE query for this particular string, suppose in LIKE I want to give"NEEL%" as first 5 characters.

Please let me knw what will be the query and also let me know is it allowed to use '%' in the VARCHAR string.

Thanks
Neelesh
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1188
Location: Bangalore,India

PostPosted: Thu Oct 12, 2006 11:03 am    Post subject:
Reply with quote

Hi there,

U can use escape along with like
escape-expression
This optional argument is an expression that specifies a character to be used to modify the special meaning of the underscore (_) and percent (%) characters in the pattern-expression. This allows the LIKE predicate to be used to match values that contain the actual percent and underscore characters.

For ur query u can use

Code:
Where col_name  LIKE 'NEEL\%%' ESCAPE '\';


Hope it will helpful
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 2 Sat Feb 24, 2018 2:15 pm
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts String after '.' (period) is not copy... balaji81_k SYNCSORT 6 Wed Aug 23, 2017 9:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us