Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Order by in forms 1

Status
Not open for further replies.

mechadios

Technical User
Nov 27, 2001
14
IN
I am having a problem regarding order by in forms. i am selecting person_id from a table and in post_query trigger am selecting the Person_name from some other table. i want the records to be sorted by person_name. how is this possible? Am on ORACLE 7.3 and i thought of creating a view as base table but then am facing problems in updating and inserting records.
Thanks
 
The only way to order by in a form like this is to create a database function that will return the same values as you are returning in your post-query. For example:

FUNCTION f_order (p_persion_id IN NUMBER)
RETURN VARCHAR2 IS
l_person_name VARCHAR2(100);
--
CURSOR cur1 IS
SELECT person_name
FROM table
WHERE person_id = p_person_id;
BEGIN
OPEN cur1;
FETCH cur1 INTO l_person_name;
CLOSE cur1;
--
Return l_person_name;
END;

Then, in the ORDER BY of your form you put the call to the function:

f_order:)block.person_id);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top