April 16, 2007, 05:08 PM
LaureIssue with pair of parens in where statement
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?
April 16, 2007, 05:22 PM
LeahWhy 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.
April 16, 2007, 05:47 PM
hammo1jThe 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!
April 16, 2007, 05:49 PM
hammo1jAs Leah says the way to cure this is to get rid of the brackets but it should still work with them.
April 16, 2007, 05:55 PM
susannahquote:
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.
April 17, 2007, 12:21 AM
Danny-SRLLaure,
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?
April 17, 2007, 07:39 AM
LaureVersion 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.