15.6 ADD_ORDER_BYプロシージャ
このプロシージャは、ORDER BYコレクションにORDER BY式を追加します。
構文
procedure add_order_by (
p_order_bys in out nocopy t_order_bys,
p_position in pls_integer,
p_direction in t_order_direction default c_order_asc,
p_order_nulls in t_order_nulls default null );
procedure add_order_by (
p_order_bys in out nocopy t_order_bys,
p_column_name in t_column_name,
p_direction in t_order_direction default c_order_asc,
p_order_nulls in t_order_nulls default null );
パラメータ
表15-4 ADD_ORDER_BYプロシージャのパラメータ
パラメータ | 説明 |
---|---|
|
ORDER BYコレクション。 |
|
指定されたデータソースの列を位置で参照します。 |
|
指定されたデータ・ソースの列名または別名を参照します。 |
|
列を昇順または降順でソートするかどうかを定義します。有効な値は |
|
NULLデータを最下位または最上位にソートするかどうかを定義します。有効な値は |
例
declare
l_order_bys apex_exec.t_order_bys;
l_context apex_exec.t_context;
begin
apex_exec.add_order_by(
p_order_bys => l_order_bys,
p_column_name => 'ENAME',
p_direction => apex_exec.c_order_asc );
l_context := apex_exec.open_web_source_query(
p_module_static_id => '{web source module static ID}',
p_order_bys => l_order_bys,
p_max_rows => 1000 );
while apex_exec.next_row( l_context ) loop
-- process rows here ...
end loop;
apex_exec.close( l_context );
exception
when others then
apex_exec.close( l_context );
raise;
end;
親トピック: APEX_EXEC