|
Sybernet / Supplied Functions Reference
Release 3.00 Oct 14, 2002 |
|
This function returns a sorted a string. It is used by sp_html_input to sort the value parameter when the type is SELECT.
The string to sort can be a simple list of names separated by a delimiter (a,b,c,d), a list of name=value pairs (1=a,2=b,3=c,4=d) in which case the 2nd node is what gets sorted, or a SQL select statement which is evaluated in real-time.
If you pass a select statement to this function, you may request at most two columns. When two columns are specified, the first column becomes the value and the second column becomes the text. The text field is sorted in this case unless your select contains an order by clause.
FUNCTION SP_SORT
(
OPTIONS VARCHAR2
, DELIMETER VARCHAR2 := ','
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
options |
The string to be sorted or the select statement to be evaludated. |
delimeter |
The delimeter that separates each entry. |
A sorted string.
The following example illustrates how to sort a simple list of names:
select http.sp_sort('X,Y,Z,A,D,B') from dual
--------------------------------------------
A,B,D,X,Y,Z
The following example illustrates how to sort columns in a table:
select http.sp_sort('select platform from http.cron_platforms') from dual
--------------------------------------------
ASTRO,KIRK,ORADEV,ORAPROD,SPOCK,TABIT