LOOKUP_FIRST_MATCHING_CF
DDL scriptArguments:
Name | Data Type | Default Value | In/Out |
---|
SERVER_ID_IN | NUMBER(38) | | IN |
PATH_IN | VARCHAR2 | | IN |
Returns:
NUMBER(38)Source
Legend: string keyword reserved word operator
1: function
2: lookup_first_matching_cf (
3: server_id_in in number,
4: path_in in varchar2
5: ) return number is
6: retval number := -1;
7: begin
8: begin
9: select a.cfid
10: into retval
11: from (
12: select b.cfid,
13: rownum rn
14: from (
15:
16:
17:
18: select cf.id cfid
19: from rhnConfigFile cf,
20: rhnConfigFileName cfn,
21: rhnConfigChannel cc,
22: rhnServerConfigChannel scc
23: where scc.server_id = server_id_in
24: and scc.config_channel_id = cc.id
25: and cc.id = cf.config_channel_id
26: and cf.state_id != lookup_cf_state('dead')
27: and cfn.path = path_in
28: and cf.config_file_name_id = cfn.id
29: order by scc.position asc
30: ) b
31: ) a
32: where a.rn = 1;
33: exception
34: when no_data_found then
35: null;
36: end;
37: return retval;
38: end lookup_first_matching_cf;