Focal Point
Dynamic Operators

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6861009331

October 13, 2005, 06:46 PM
KarateExplosion
Dynamic Operators
I would like the my procedure to have dynamic operators. For example: A user could select equals, does not equal, contains, etc. from a drop down to determine how the parameter is interpreted by the procedure.

Account Number equals 1234 or
Account Number contains 3 or
Account Number is like %21

With the operator being seleted from a drop down list.
Any help is greatly appreciated.
October 13, 2005, 07:37 PM
Cyril Joy
This is a part of code which i have done for building the where clause for selection. Give different names to the items in the drop menu to identify it by WF.

-IF &TXT_PARTID EQ ' ' GOTO NO6C;
-SET WHRCLS6 = IF &WHRCLS6 NE '' THEN &WHRCLS6 || ' AND ' ELSE '';
-IF &RAD_PRTNUM NE 'E' GOTO NO6CA;
-SET WHRCLS6 = &WHRCLS6 || ' A.PART_ID LIKE (''%' || &TXT_PARTID || ''')';
-NO6CA
-IF &RAD_PRTNUM NE 'S' GOTO NO6CB;
-SET WHRCLS6 = &WHRCLS6 || ' A.PART_ID LIKE (''' || &TXT_PARTID || '%'')';
-NO6CB
-IF &RAD_PRTNUM NE 'C' GOTO NO6CC;
-SET WHRCLS6 = &WHRCLS6 || ' A.PART_ID LIKE (''%' || &TXT_PARTID || '%'')';
-NO6CC
-IF &RAD_PRTNUM NE 'N' GOTO NO6CD;
-SET WHRCLS6 = &WHRCLS6 || ' A.PART_ID <> ''' || &TXT_PARTID || '''';
-NO6CD
-IF &RAD_PRTNUM NE 'D' GOTO NO6CE;
-SET WHRCLS6 = &WHRCLS6 || ' A.PART_ID NOT LIKE ( ''%' || &TXT_PARTID || ''')';
-NO6CE
-IF &RAD_PRTNUM NE 'Q' GOTO NO6C;
-SET WHRCLS6 = &WHRCLS6 ||' A.PART_ID LIKE ( ''' || &TXT_PARTID || ''')';
-NO6C
October 13, 2005, 08:35 PM
susannah
have in your form
<SELECT NAME="RELAT" >
<OPTION VALUE=" GE ">greater than or equal to</option>
<option value=" CONTAINS ">contains</option>
...etc
</select>
and then in your fex
-DEFAULT &RELAT = ' EQ ' ;
TABLE FILE ....
WHERE SOMEVAR &RELAT SOMEVALUE
...
END
works.
October 14, 2005, 02:22 PM
<toby mills>
Do it like susannah says.... Simple and straight forward.

-Toby
October 14, 2005, 02:52 PM
KarateExplosion
Thanks for the tips. I did it the way Susannah suggested and it was very straightforward and gave me exaxtly what I was looking for.