Focal Point
[SOLVED] Multi Value Select Results and MSS (Sequal Server Queries)

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

May 10, 2010, 10:13 AM
Tom F
[SOLVED] Multi Value Select Results and MSS (Sequal Server Queries)
The result set from a Multi Value List sends the results as 'value1' OR 'value2' (with the quotes) to the WebFOCUS procedure. I have reviewed numerous posts about STRIP and STRREP and none of these approaches have worked to change the return set from above to a statement that Sequal Server will accept. I need to have the values as IN ('value1','value2'). Thanks

This message has been edited. Last edited by: Kerry,
May 10, 2010, 10:32 AM
Tom Flynn
  
-SET &QT = '''';
-*************************
-* Single Selection
-*************************
-* SET &TERMWH = &QT | '201010' | &QT ;
-*************************
-* Multi Selection
-*************************
-SET &TERMWH = &QT | '201010' | &QT  | ' OR ' | &QT | '201020' | &QT  | ' OR ' | &QT | '201030' | &QT ;
-*************************
-* Generate Where Statement
-*************************
-SET &WHERE_TERM = IF &TERMWH OMITS 'OR' THEN 'WHERE TERM IN (' | &TERMWH | ');' 
-                                        ELSE 'WHERE TERM IN (';

-IF &TERMWH OMITS 'OR' GOTO X_WHERE1;

-SET &X_TERMWH = STRREP(&TERMWH.LENGTH, &TERMWH, 4, ' OR ', 1, ',', &TERMWH.LENGTH, 'A&TERMWH.LENGTH'); 
-SET &WHERE_TERM = &WHERE_TERM | &X_TERMWH || ');';

-X_WHERE1

-TYPE &WHERE_TERM
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 10, 2010, 01:49 PM
Tom F
Thanks you very much. That works. You are a life saver.
May 10, 2010, 01:50 PM
Tom F
Tom Farynowski