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

LOOKUP_TAG

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
ORG_ID_INNUMBER(38) IN
NAME_INVARCHAR2 IN

Returns:

NUMBER(38)

Source

Legend: comment string keyword reserved word operator
     1: function
     2: lookup_tag(org_id_in in number, name_in in varchar2)
     3: return number
     4: is
     5:     pragma autonomous_transaction;
     6:     tag_id  number;
     7: begin
     8:     select id
     9:       into tag_id
    10:       from rhnTag
    11:      where org_id = org_id_in and
    12:            name_id = lookup_tag_name(name_in);
    13: 
    14:     return tag_id;
    15: exception when no_data_found then
    16:     begin
    17:         tag_id := insert_tag(org_id_in, name_in);
    18:     exception when dup_val_on_index then
    19:         select id
    20:           into tag_id
    21:           from rhnTag
    22:          where org_id = org_id_in and
    23:                name_id = lookup_tag_name(name_in);
    24:     end;
    25:     return tag_id;
    26: end;