Re: Developer 2000 Forms order by clause
Date: 2000/05/17
Message-ID: <jGY6D9A7rnI5EwIp_at_ahardy.demon.co.uk>#1/1
In article <8fssp3$k5v$1_at_nnrp1.deja.com>, Tuan Nguyen <bk35_at_my-deja.com>
writes
>Another solution:
>If that display field can be populated from base table column(s) then
>it should be possible to write a db function with such base table
>column(s) used as input params and return the value for the display
>field. After that you can freely add order clause for the block like
>that:
>
>order by function_name(column1,column2)
This is the method that I use and like!
You might find it useful to create a package on the server which just returns values based on the input e.g. to return the description from a table based on the identifier.
Given:
CREATE OR REPLACE
PACKAGE return_value
IS
FUNCTION material_description (p_material_id materials.material_id%TYPE)
RETURN VARCHAR2
;
PRAGMA RESTRICT_REFERENCES(material_description, WNDS, WNPS);
END return_value;
You can then use this function in both the post-query and the order by clause, e.g.:
POST-QUERY
:my_block.description := return_value.material_description(:my_block.mat
erial_id);
and
ORDER BY
return_value.material_description(material_id)
I *think* that you need to use a package so that you can use PRAGMA RESTRICT REFERENCES to WNDS, WNPS.
Andy
-- Andy Hardy. PGP ID: 0xA62A4849 ===============================================================Received on Wed May 17 2000 - 00:00:00 CEST