IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Issue with pair of parens in where statement
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Silver Member
Posted
Can anyone tell me why this is happening?
I've a where statement that evaluates to the following: WHERE FIELD EQ '(anytexthere)'
and every row is returned from my table. It does not matter if there is text between the ()'s or not. The fact that there is an open and close appears to cause the all rows returned situation.

See the sample CAR table code below.



SAMPLE CODE:

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE COUNTRY EQ '(ENGLAND)'
END

-*******************
RESULTS:
COUNTRY CAR MODEL
ENGLAND JAGUAR V12XKE AUTO
ENGLAND JAGUAR XJ12L AUTO
ENGLAND JENSEN INTERCEPTOR III
ENGLAND TRIUMPH TR7
JAPAN DATSUN B210 2 DOOR AUTO
JAPAN TOYOTA COROLLA 4 DOOR DIX AUTO
ITALY ALFA ROMEO 2000 4 DOOR BERLINA
ITALY ALFA ROMEO 2000 GT VELOCE
ITALY ALFA ROMEO 2000 SPIDER VELOCE
ITALY MASERATI DORA 2 DOOR
W GERMANY AUDI 100 LS 2 DOOR AUTO
W GERMANY BMW 2002 2 DOOR
W GERMANY BMW 2002 2 DOOR AUTO
W GERMANY BMW 3.0 SI 4 DOOR
W GERMANY BMW 3.0 SI 4 DOOR AUTO
W GERMANY BMW 530I 4 DOOR
W GERMANY BMW 530I 4 DOOR AUTO
FRANCE PEUGEOT 504 4 DOOR


Why are all the rows returned?


Laure


Prod: WebFOCUS 7.6.4 - MRE, BID, - WindowsXP - Oracle 9i, SQLServer, DevStudio 7.6 - Apache Tomcat , Output: HTML, Excel 2000 and PDF
 
Posts: 38 | Location: Florida | Registered: December 07, 2006Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Why do you have the parenthesis there any way? In the context you have, I think the JAVA interpreter is going out to lunch so to speak and ignoring the WHERE.


Leah
 
Posts: 1307 | Location: Council Bluffs, IA | Registered: May 24, 2004Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
The bracket syntax normally refers to the contents of a file eg

APP FILEDEF GOODCAR DISK CAR.FTM

TABLE FILE CAR
PRINT COUNTRY CAR
IF CAR EQ (GOODCAR)

So this might be the reason Wf is being very, very naughty!



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 848 | Location: Airstrip One | Registered: October 06, 2006Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
As Leah says the way to cure this is to get rid of the brackets but it should still work with them.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 848 | Location: Airstrip One | Registered: October 06, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
quote:
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE COUNTRY EQ '(ENGLAND)'
END

when i run your exact code , i get
0 ERROR AT OR NEAR LINE 13 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC038) THE EXTERNAL FILE DOES NOT CONTAIN ANY TEST LITERALS: ENGLAND
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT
We don't know what version or platform you are on, so we ask that you edit your profile signature.




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2624 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
Laure,

quote:
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE COUNTRY EQ '(ENGLAND)'
END


When I run your code in Dev. Studio 7.1.3 I get this:
-* File Laure1.fex
 TABLE FILE CAR
 PRINT COUNTRY CAR MODEL
 WHERE COUNTRY EQ '(ENGLAND)'
 END
 0 NUMBER OF RECORDS IN TABLE=        0  LINES=      0



So, on what system are you running? Which version of WF?


Daniel
wf 7.6/WinXP/IIS/SSA
www.wrapapp.com
www.srl.co.il

 
Posts: 594 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteEdit or Delete MessageReport This Post
Silver Member
Posted Hide Post
Version 7.6 windows XP

I agree, remove the parens. Issue is the problem was found when using a & parameter in the where statement that was populated from a drop downlist box that read the data. The customer has keyed the value to contain the parens. We're working with our customer to cleans their data, but I would like to try and understand what is going on here. I think Leah is likely correct about the JAVA compiler.

Thanks.


Laure


Prod: WebFOCUS 7.6.4 - MRE, BID, - WindowsXP - Oracle 9i, SQLServer, DevStudio 7.6 - Apache Tomcat , Output: HTML, Excel 2000 and PDF
 
Posts: 38 | Location: Florida | Registered: December 07, 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Issue with pair of parens in where statement

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