Sybernet / Supplied Functions Reference
Release 3.00
Oct 14, 2002
backwards forwards

HTTP.SP_SORT

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.

Syntax

FUNCTION SP_SORT
(
    OPTIONS                       VARCHAR2
,   DELIMETER                     VARCHAR2 := ','
)
RETURN VARCHAR2;

Parameters

Parameter Description
options
 
The string to be sorted or the select statement to be evaludated.
delimeter
 
The delimeter that separates each entry.

Returns

A sorted string.

Example 1

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

Example 2

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

See Also

SP_HTML_INPUT


Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/