IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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: 1448
Location: Chicago, IL

PostPosted: Tue Feb 21, 2006 4:54 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Rexx pattern matching on PS qualifer ... CLIST & REXX 1
No new posts File matching functionality in Easytr... DFSORT/ICETOOL 14
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
Search our Forums:

Back to Top