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

LOOKUP_CHECKSUM

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
CHECKSUM_TYPE_INVARCHAR2 IN
CHECKSUM_INVARCHAR2 IN

Returns:

NUMBER(38)

Source

Legend: comment string keyword reserved word operator
     1: function
     2: lookup_checksum(checksum_type_in in varchar2, checksum_in in varchar2)
     3: return number
     4: is
     5:         checksum_id     number;
     6: begin
     7:         if checksum_in is null then
     8:                 return null;
     9:         end if;
    10: 
    11:         select c.id
    12:           into checksum_id
    13:           from rhnChecksumView c
    14:          where c.checksum = checksum_in
    15:            and c.checksum_type = checksum_type_in;
    16: 
    17:         return checksum_id;
    18: exception when no_data_found then
    19:     begin
    20:         select insert_checksum(checksum_in, checksum_type_in) into checksum_id from dual;
    21:     exception when dup_val_on_index then
    22:         select c.id
    23:           into checksum_id
    24:           from rhnChecksumView c
    25:          where c.checksum = checksum_in
    26:           and c.checksum_type = checksum_type_in;
    27:     end;
    28:     return checksum_id;
    29: end;