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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Need info on EIBCPOSN value in IBM FA... subratarec CICS 11 Wed Jul 12, 2017 3:45 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm


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