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
 

 

what is " like '%<pattern>%' " equivalent i

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

New User


Joined: 10 Jan 2006
Posts: 14
Location: India

PostPosted: Tue Feb 21, 2006 10:42 am    Post subject: what is " like '%<pattern>%' " equivalent i
Reply with quote

Hi People,

I'm running a SQL in sql server for getting some records on the basis of a pattern.

Query - select * from <table> where Name like '%CLOSED%'

When I'm trying to get the exactly same thing in DB2 its not working.

Thanks in advance for alternative solution or else correcting me.

Deeps
Back to top
View user's profile Send private message

prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Tue Feb 21, 2006 11:14 am    Post subject:
Reply with quote

WHAT IS THE ERROR U GET?
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Feb 21, 2006 11:20 am    Post subject:
Reply with quote

Hi toughmetals,
I am mentioning you the correct form of your query. Please change ur query and it will work. The query will bw like -
select * from <System_name>.<table_name>
where STRM_NM like '%RVD%'
Here STRM_NM is character attribute. U should use like command for only the char attributes. It will not work if you want to use it with some integer or float attributes.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Feb 21, 2006 4:54 pm    Post subject: Re: what is " like '%<pattern>%' " equivale
Reply with quote

amitava wrote.
Quote:
Here STRM_NM is character attribute. U should use like command for only the char attributes. It will not work if you want to use it with some integer or float attributes.

I assume NAME as a character field only... its difficult to proceed without looking at SQL CODE & Error Message...

Regards,

Priyesh.
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 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
No new posts "DFSRRC00 vs IKJEFT01" for ... arunsoods All Other Mainframe Topics 5 Fri Aug 12, 2016 9:54 pm
No new posts Need to show date in "DYYMMDD.TH... deepak_shrivastava DFSORT/ICETOOL 2 Tue Jan 05, 2016 7:15 pm


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