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

LOOKUP_SOURCE_NAME

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
NAME_INVARCHAR2 IN

Returns:

NUMBER(38)

Source

Legend: comment string keyword reserved word operator
     1: function
     2: lookup_source_name(name_in in varchar2)
     3: return number
     4: is
     5:     source_id   number;
     6: begin
     7:     select id
     8:       into source_id
     9:       from rhnSourceRPM
    10:      where name = name_in;
    11: 
    12:     return source_id;
    13: exception when no_data_found then
    14:     begin
    15:         source_id := insert_source_name(name_in);
    16:     exception when dup_val_on_index then
    17:         select id
    18:           into source_id
    19:           from rhnSourceRPM
    20:          where name = name_in;
    21:     end;
    22:     return source_id;
    23: end;