Saturday, 28 April 2012

Demonstrate Oracle database types and object tables


drop type employee_typ;
 
create type employee_typ as object (
        empno NUMBER,
        emp_name varchar2(30),
        hiredate date,
        member function days_at_company return NUMBER,
        pragma restrict_references(days_at_company, WNDS)
)
------------ 
create type body employee_tye is
begin
        member function days_at_company return number is
        begin
                return (SYSDATE-hiredate);
        end;
end;

No comments:

Post a Comment