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

LOOKUP_TAG_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_tag_name(name_in in varchar2)
     3: return number
     4: is
     5: 	pragma autonomous_transaction;
     6: 	name_id     number;
     7: begin
     8:     select id
     9:       into name_id
    10: 	  from rhnTagName
    11: 	 where name = name_in;
    12: 
    13:     return name_id;
    14: exception when no_data_found then
    15:     begin
    16:         name_id := insert_tag_name(name_in);
    17:     exception when dup_val_on_index then
    18:         select id
    19:           into name_id
    20:     	  from rhnTagName
    21:     	 where name = name_in;
    22:     end;
    23:     return name_id;
    24: end;