Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: package body invalidated
Hi Everybody,
The package body gets into a "Invalid" status when one of its dependent objects gets changed. This may be due to a schema change, drop/rename of table etc...
Under such situations, procedures/packages and triggers gets into "Invalid" status. Triggers compile automatically at runtime if they are in "Invalid" status. Procedures/packages do not.
Hope this helps...
Regards
Rajagopal Venkataramany
On Mon, 20 Nov 2000 11:26:51 -0800, ORACLE-L_at_fatcity.com wrote:
> The package body does not have any errors. When I compile it it become
valid
> again.
> =20
> =20
> =20 > =20
> =20
> =20
> =20
> function cleanupEntityId(p_id in varchar2) return varchar2;
> =20
> procedure validateEntityId(p_type in integer, p_id in varchar2);
> =20
> function getEntityDisplay(
> p_type in integer,
> p_id in varchar2,
> p_onNotFound in varchar2 :=3D NULL) retu=
rn
> =20
> PNAMESTYLE_SHORT constant integer :=3D 0;
> PNAMESTYLE_SIMPLE constant integer :=3D 1;
> PNAMESTYLE_COMPLETE constant integer :=3D 2;
> PNAMESTYLE_SHORT_SORTABLE constant integer :=3D 3;
> PNAMESTYLE_SORTABLE constant integer :=3D 4;
> =20
> ADDRSTYLE_HTML constant integer :=3D 0;
> =20
> function getPersonAge(p_birthDate in date) return varchar2;
> =20
> function createPersonName(
> p_style in integer,
> p_name_Prefix in varchar2,
> p_name_First in varchar2,
> p_name_Middle in varchar2,
> p_name_Last in varchar2,
> p_name_Suffix in varchar2) return
varchar2; > =20
> function createAddress(
> p_style in integer,
> p_line1 in varchar2,
> p_line2 in varchar2,
> p_city in varchar2,
> p_state in varchar2,
> p_zip in varchar2) return varchar2;
> =20
> PRAGMA RESTRICT_REFERENCES(getPersonAge, WNDS, WNPS, RNPS);
> =20
> =20 > =20
> =20v_nameMiddle
> function CleanupEntityId(p_id in varchar2) return varchar2 is
> begin
> if p_id is null then
> return null;
> else
> return upper(p_id);
> end if;
> end;
> =20
> procedure validateEntityId(p_type in integer, p_id in varchar2)
is
> begin
> NULL;
> end;
> =20
> function getEntityDisplay(p_type in integer, p_id in varchar2,
> p_onNotFound in varchar2) return varchar2 is
> v_display varchar2(512) :=3D NULL;
> begin
> if p_type =3D 0 then
> select SIMPLE_NAME into v_display from person
> where person_id =3D p_id;
> elsif p_type =3D 1 then
> select NAME_PRIMARY into v_display from org
> where org_internal_id =3D p_id;
> end if;
> if v_display is null then
> if p_onNotFound is not null then
> v_display :=3D p_onNotFound;
> else
> v_display :=3D '"' || p_id || '" (' ||
p_type
> || ') not found';
> end if;
> end if;
> return v_display;
> end;
> =20
> function getPersonAge(p_birthDate in date) return varchar2 is
> v_ageMonths number;
> begin
> if p_birthDate is null then
> return null;
> else
> v_ageMonths :=3D MONTHS_BETWEEN(SysDate,
p_birthDate);
> if v_ageMonths > 12 then
> return to_char(trunc(v_ageMonths/12));
> elsif v_ageMonths > 1 then
> return to_char(trunc(v_ageMonths)) || '
> months';
> elsif v_ageMonths =3D 1 then
> return to_char(trunc(v_ageMonths)) || '
> month';
> else
> return to_char(trunc(v_ageMonths * 30))
|| '
> days';
> end if;
> end if;
> end;
> =20
> function createPersonName(
> p_style in integer,
> p_name_Prefix in varchar2,
> p_name_First in varchar2,
> p_name_Middle in varchar2,
> p_name_Last in varchar2,
> p_name_Suffix in varchar2) return
varchar2
> is
> v_namePrefix varchar2(32);
> v_nameMiddle varchar2(64);
> v_nameSuffix varchar2(32);
> begin
> if p_name_Prefix is NULL then
> v_namePrefix :=3D '';
> else
> v_namePrefix :=3D p_name_Prefix || ' ';
> end if;
> if p_name_Middle is NULL then
> v_nameMiddle :=3D '';
> else
> v_nameMiddle :=3D ' ' || p_name_Middle;
> end if;
> if p_name_Suffix is NULL then
> v_nameSuffix :=3D '';
> else
> v_nameSuffix :=3D ' ' || p_name_Suffix;
> end if;
> =20
> if p_style =3D PNAMESTYLE_SHORT then
> return substr(p_name_first, 1, 1) || ' ' ||
> p_name_Last;
> elsif p_style =3D PNAMESTYLE_SIMPLE then
> return p_name_First || v_nameMiddle || ' ' ||
> p_name_Last || v_nameSuffix;
> elsif p_style =3D PNAMESTYLE_COMPLETE then
> return v_namePrefix || p_name_First ||
> =20
> function createAddress(
> p_style in integer,
> p_line1 in varchar2,
> p_line2 in varchar2,
> p_city in varchar2,
> p_state in varchar2,
> p_zip in varchar2) return varchar2 is
> v_address varchar2(512);
> begin
> v_address :=3D p_line1;
> if not(p_line2 is NULL) and (length(p_line2) > 0) then
> v_address :=3D v_address || '<br>' || p_line2;
> end if;
> v_address :=3D v_address || '<br>' || p_city || ', ' ||
> p_state || ' ' || p_zip;
> return v_address;
> end;
> =20
> =20 > =20
> =20> To REMOVE yourself from this mailing list, send an E-Mail message
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------