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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FOCUS to SQL conversion issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] FOCUS to SQL conversion issue
 Login/Join
 
Platinum Member
posted
I have a condition similar to
WHERE (COUNTRY IN ('ENGLAND','ITALY')) OR (COUNTRY IN ('USA','INDIA'));
when passed to database it is converted into

COUNTRY IN ('ENGLAND','ITALY','USA','INDIA') but I want it to be like

COUNTRY IN ('ENGLAND','ITALY') OR COUNTRY IN ('USA','INDIA') when using AND instead of OR I am seeing it is converted in the correct way i.e

WHERE (COUNTRY IN ('ENGLAND','ITALY')) AND (COUNTRY IN ('USA','INDIA')); to
COUNTRY IN ('ENGLAND','ITALY') AND COUNTRY IN ('USA','INDIA')

Is there a way to convert the FOCUS OR condition in the same lines as in AND. We are using Oracle as the DB.

Thanks for any help!

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
Virtuoso
posted Hide Post
as long as it returns the correct result without degrading performance, what does it matter?
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
The issue is I have a HOLDFILE which contains order numbers and depending on the execution criteria the number of order numbers in the HOLDFILE may be less than or greater than 1000 rows.
This HOLDFILE is used in the where clause of another TABLE request using IN FILE HOLDFILE when records in the HOLDFILE are more than 1000 the SQL is failing as Oracle limits 1000 values in the where clause condition.

Using dialogue manager commands I have separated the records more than 1000 and want to put them in the OR condition instead of all in single flow like

COUNTRY IN ('ENGLAND','ITALY') OR COUNTRY IN ('USA','INDIA').

Because FOCUS to SQL conversion is putting everything as COUNTRY IN ('ENGLAND','ITALY','USA','INDIA') I had to replace the entire section of the FOCUS code with SQL PASS THRU where the OR condition remains as is. If the conversion works as needed then I can use the FOCUS code back in place instead of SQL PASS THRU.


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
Virtuoso
posted Hide Post
This works, in 7.6.10:
TABLE FILE mytable
LIST *
WHERE (mykey IN FILE 'LIST1' AND 1 EQ 1)
   OR (mykey IN FILE 'LIST2' AND 1 NE 2);
END


Explanation:
"1 eq 1" evaluates to True;
"[assertion1] and True" is equivalent to just "[assertion1]"

But WF is not sufficiently intelligent or presumptuous to delete "and 1 eq 1" / "and 1 ne 2", so it generates

where (mykey in (first,list,of,values) and 1 = 1) or (mykey in (second,list,of,values) and 1 <> 2)


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Hi Jack,

Thanks for the suggestion! Adding 'AND 1 = 1' in the first list itself worked and no need for additional conditions.

Thanks again!


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FOCUS to SQL conversion issue

Copyright © 1996-2020 Information Builders