Posted on 2005-02-27
how `can we implement a sort function when making a method. This is what we have so far.....
CREATE TYPE Employment_Type AS OBJECT (Employment_ID NUMBER(10), Employment_type varchar2(10), Client REF Client_Type, Completion_Date DATE);
CREATE TABLE Employment OF Employment_Type(Employment_ID PRIMARY KEY);
now, i'm trying to make a method that will sort the dates of completion_date by most recent ones. Here is where i have encountered a problem because i don't know how to sort the completion_date attribute so that it prints out the most recent date that table employment holds.
this is what i have so far and where i am stuck:
create or replace type body employment_type as
member function most_recent ( m most_recent_type)
return date is
****here is where i'm supposed to make a comparison and see which date is the most recent one to return ----how do i do this******
thank you very much for your suggestions