Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need info about "like"

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

New User


Joined: 29 Mar 2005
Posts: 2

PostPosted: Tue Apr 12, 2005 11:14 pm    Post subject: Need info about "like"
Reply with quote

How should I use "like" in a query when I want to select records having data that end with some character...... let's say we have London, Japan as data ... then can I use
Code:

"select country from sometable where cname like     '%n'       "

I tried this but I couldn't get any results ....so if anyone knows why can you please help?
Back to top
View user's profile Send private message

radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Wed Apr 13, 2005 1:47 pm    Post subject:
Reply with quote

Use the query below.

select country from sometable where cname like '%N'.(try with caps N inside the quotes)

Let us know whether its working fine now or having other problem.
does it displays any sql error message?
Back to top
View user's profile Send private message
sivapotla

New User


Joined: 29 Mar 2005
Posts: 2

PostPosted: Wed Apr 13, 2005 11:46 pm    Post subject: Re: Need info about "like"
Reply with quote

Hello Krishnan thanks for ur reply,
i already tried this option,
there were no errors,
the problem is there was no output...
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed May 04, 2005 2:16 pm    Post subject:
Reply with quote

Hi Siva,

Please refer to the link http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/r0008190.htm for more information on LIKE.

Thanks,
Reddy
Back to top
View user's profile Send private message
gvt460

New User


Joined: 04 Mar 2005
Posts: 23

PostPosted: Thu May 05, 2005 4:43 pm    Post subject:
Reply with quote

hi ur query is perfectly allright.
i tried it and it workd

select * from tablename where name like '%d';

vikram yadav
Back to top
View user's profile Send private message
avalanches

New User


Joined: 10 May 2005
Posts: 28

PostPosted: Tue May 10, 2005 3:21 pm    Post subject: Need info about "like"
Reply with quote

There might not be any values matching this pattern also because the query is not resulting with a row.

How do I find out is there are any char ending with '%' itself?!?!?!
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 Need info with DBRC recovery ashek15 IMS DB/DC 0 Mon Jan 23, 2017 6:43 am
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us