LOOKUP_SOURCE_NAME
DDL scriptArguments:
Name | Data Type | Default Value | In/Out |
---|
NAME_IN | VARCHAR2 | | IN |
Returns:
NUMBER(38)Source
Legend: 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;