Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Jobs Sanity Check Index DDL scrips
Arguments Source

LOOKUP_PACKAGE_CAPABILITY

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
NAME_INVARCHAR2 IN
VERSION_INVARCHAR2 IN

Returns:

NUMBER(38)

Source

Legend: comment string keyword reserved word operator
     1: function
     2: lookup_package_capability(name_in in varchar2, version_in in varchar2 default null)
     3: return number
     4: is
     5:     name_id		number;
     6: begin
     7:     if version_in is null then
     8:         select id
     9:           into name_id
    10:           from rhnPackageCapability
    11:          where name = name_in and
    12:                version is null;
    13:     else
    14:         select id
    15:           into name_id
    16:           from rhnPackageCapability
    17:          where name = name_in and
    18:                version = version_in;
    19: 	end if;
    20: 	return name_id;
    21: exception when no_data_found then
    22:     begin
    23:         name_id := insert_package_capability(name_in, version_in);
    24:     exception when dup_val_on_index then
    25:         if version_in is null then
    26:             select id
    27:               into name_id
    28:               from rhnPackageCapability
    29:              where name = name_in and
    30:                    version is null;
    31:         else
    32:             select id
    33:               into name_id
    34:               from rhnPackageCapability
    35:              where name = name_in and
    36:                    version = version_in;
    37: 	end if;
    38: 
    39:     end;
    40: 	return name_id;
    41: end;