At 02:56 PM 7/26/2013, Bruce A. Chitiea wrote:
--Start Example
--The LISTOF function concatenates column values into a comma-separated
list.
--1. Capture the list of column values into a source variable
--2. Wrap the ColumName with four (4) quotes to capture all <spaces>
--3. Wrap the source variable with parentheses to create the target variable
--4. Ampersand the target within the test statement
SELECT LISTOF('''' + Dumpty + '''') INTO vDumptyList FROM zEggMan
SET VAR vHumpty TEXT = ('(' + .vDumptyList + ')')
IF vPPiper NOT IN &vHumpty THEN ...
--End Example
Bruce,
You may want to add the following to your list above ...
. Be sure to pre-define all variables with correct data type as NULL.
. Not knowing the result (length of resulting string) of LISTOF in
advance, you may need to pre-define your data type as NOTE.
. When SELECTing the result INTO a Variable, always use the
INDICATOR variable.
If you omit indicator variables, R:BASE displays a message and assigns a
negative integer to SQLCODE if it encounters a null value. The command
continues to process rows.
-- Example
SET VAR vDumptyList NOTE = NULL
SET VAR vHumpty NOTE = NULL
SELECT LISTOF('''' + Dumpty + '''') INTO vDumptyList INDIC iv1 FROM zEggMan
SET VAR vHumpty = ('(' + .vDumptyList + ')')
Very Best R:egards,
Razzak.
www.rbase.com
www.facebook.com/rbase
--
30+ years of continuous innovation!
15 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--