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: select cf.id cfid
16: from rhnConfigFile cf,
17: rhnConfigFileName cfn,
18: rhnConfigChannel cc,
19: rhnServerConfigChannel scc
20: where scc.server_id = server_id_in
21: and scc.config_channel_id = cc.id
22: and cc.id = cf.config_channel_id
23: and cf.state_id != lookup_cf_state('dead')
24: and cfn.path = path_in
25: and cf.config_file_name_id = cfn.id
26: order by scc.position asc
27: ) b
28: ) a
29: where a.rn = 1;
30: exception
31: when no_data_found then
32: null;
33: end;
34: return retval;
35: end lookup_first_matching_cf;