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

LOOKUP_FIRST_MATCHING_CF

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
SERVER_ID_INNUMBER(38) IN
PATH_INVARCHAR2 IN

Returns:

NUMBER(38)

Source

Legend: comment 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: 				-- We don't need to test latest any more,
    16: 				-- because we're not looking for a revision at
    17: 				-- all, just the file with the right path
    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;