Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Like operator
 Login/Join
 
<B_B>
posted
Hi,
I need to give a where clause using 'like' with 2 string values.
e.g. w
where column_name like 'abc' and 'xyz'

What would be the right syntax?
 
Report This Post
<JG>
posted
quote:
where column_name like 'abc' and 'xyz'


It totally depends on where you want the comparison

WHERE column_name LIKE 'abc%_' OR 'xyz%_'

I'm sure for such a well documented basic WebFocus process
learning to read would help you a great deal in your tasks.
 
Report This Post
Expert
posted Hide Post
I agree with JG

As Tony A has mentioned many times the link at the top right of the page will get you to the documentation.

Although I would code
WHERE column_name LIKE '%abc%'
AND column_name LIKE '%xyz%'


Depending on what you mean by like and the values. Does it contain abc and xyz?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Tony is correct. It needs to be an OR not an AND. Otherwise you won't get any data.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<JG>
posted
Ginny,

Tony is correct, IF you want the column to contain BOTH 'abc' AND 'xyz'

However if you require either/or then 'OR' is required, The % at the the begining or/end
depends on the postion of the search string.

quote:
It totally depends on where you want the comparison


Should perhaps have been Where and What you want the comparison to be.
 
Report This Post
Expert
posted Hide Post
The issue with getting no data comes down to how you code the WHERE clause

TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY LIKE '%E%' AND '%G%'
END

Produces an error

TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY LIKE '%E%' OR '%G%'
END

Produces a list of ENGLAND, W GERMANY, FRANCE.

But if you use
TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY LIKE '%E%' AND COUNTRY LIKE '%G%'
END

You get ENGLAND, W GERMANY


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders