Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] FOCUS to SQL conversion issue
Go
New
Search
Notify
Tools
Reply
  
[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: 103 | Location: Indianapolis | Registered: November 08, 2007Reply With QuoteReport 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, 2005Reply With QuoteReport 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: 103 | Location: Indianapolis | Registered: November 08, 2007Reply With QuoteReport 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, 2005Reply With QuoteReport 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: 103 | Location: Indianapolis | Registered: November 08, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

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

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.