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
 
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
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
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
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us