Jul 222013
 
create package compile as

  subtype type is varchar2(10);
  constant constant type := 'constant';

  function function return type;
  
  procedure function;

end compile;
/

create package body compile as

  function function return type as
  begin
    return constant;
  end;

  procedure function as
  begin
    dbms_output.put_line(function);
  end;
  
end compile;
/

select compile.function from dual;

constant

exec compile.function;

constant

You will get a bunch of compiler warnings about this, but 
Oracle will happily let you create and use this package. 
Please don't do this for real though (unless you want everyone 
who maintains this code in the future to curse your name :)

Inspired by this stack overflow question.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)