LOOKUP_XCCDF_IDENT
DDL scriptArguments:
Name | Data Type | Default Value | In/Out |
---|
SYSTEM_IN | VARCHAR2 | | IN |
IDENTIFIER_IN | VARCHAR2 | | IN |
Returns:
NUMBER(38)Source
Legend: string keyword reserved word operator
1: function
2: lookup_xccdf_ident(system_in in varchar2, identifier_in in varchar2)
3: return number
4: is
5: pragma autonomous_transaction;
6: xccdf_ident_id number;
7: ident_sys_id number;
8: begin
9: begin
10: select id
11: into ident_sys_id
12: from rhnXccdfIdentSystem
13: where system = system_in;
14: exception when no_data_found then
15: begin
16: ident_sys_id := insert_xccdf_ident_system(system_in);
17: exception when dup_val_on_index then
18: select id
19: into ident_sys_id
20: from rhnXccdfIdentSystem
21: where system = system_in;
22: end;
23: end;
24:
25: select id
26: into xccdf_ident_id
27: from rhnXccdfIdent
28: where identsystem_id = ident_sys_id and identifier = identifier_in;
29: return xccdf_ident_id;
30: exception when no_data_found then
31: begin
32: xccdf_ident_id := insert_xccdf_ident(ident_sys_id, identifier_in);
33: exception when dup_val_on_index then
34: select id
35: into xccdf_ident_id
36: from rhnXccdfIdent
37: where identsystem_id = ident_sys_id and identifier = identifier_in;
38: end;
39: return xccdf_ident_id;
40: end lookup_xccdf_ident;