oracle - Create or replace global subtype -
i know can create subtype inside package specification like:
create or replace package xy subtype type_sdebug varchar (200); ... end; /
if want use same subtype within package need redefine same type again. there way create or replace global subtype such as:
create or replace type string_array varray(500) of varchar2(30); /
as far know, subtypes pl/sql feature, cannot create them globally. nothing prevents using type defined in package xy
in package (e.g. ab
):
create or replace package xy subtype type_sdebug varchar (200); end; create or replace package ab procedure print_it(p_debug in xy.type_sdebug); end; create or replace package body ab procedure print_it(p_debug in xy.type_sdebug) begin dbms_output.put_line(p_debug); end; end; declare v_debug xy.type_sdebug default 'hello world'; begin ab.print_it(v_debug); end;
Comments
Post a Comment