![]() |
PING
0.9
Statistical data handling and processing in production environment
|
Transform an unformatted list of items into a SQL-compatible list of comma-separated and/or quote-enhanced items.
list : a list of blank separated items/char;type : (option) flag set to force the type of the items in list; it is either NUMERIC for items regarded as all numeric or CHAR for items regardard as alphanumeric items; default (empty): the type will be determined (using datatyp) depending on the type of the first item.sqllist : output formatted list of comma-separated, quoted items, in between parentheses.
The simple examples below:
return olist1=("DE","AT","BE","NL","UK","SE") and olist2=(1,2,3,4,5,6) respectively, while:
return olist2p=("1","2","3","4","5","6").
This is nothing else than a wrapper to %list_quote, where parentheses () are added around the output list, i.e. the command let sqllist = %sql_list(&list) is equivalent to:
when list is of type CHAR, otherwise, when list if of type NUMERIC: