[Home] [Help]
298:
299: -- cursor to retrieve templates associated to the rule
300: CURSOR template_cursor IS
301: select distinct(temp.template_id) Template_Id, temp.org_id, temp.intent
302: from OKC_XPRT_TEMPLATE_RULES rules, okc_terms_templates_all temp
303: where rules.rule_id = p_rule_id
304: and rules.template_id = temp.template_id
305: and (sysdate between nvl(temp.start_date, sysdate) and nvl(temp.end_date, sysdate ))
306: UNION
304: and rules.template_id = temp.template_id
305: and (sysdate between nvl(temp.start_date, sysdate) and nvl(temp.end_date, sysdate ))
306: UNION
307: -- Org Wide Rule templates. Reverted back the changes done for 5019422 by removing
308: -- join to okc_xprt_template_rules
309: SELECT t.template_id, t.org_id, t.intent
310: FROM okc_terms_templates_all t,
311: okc_xprt_rule_hdrs_all r
312: WHERE t.org_id = r.org_id
398: and outcome.object_type = ''QUESTION''
399: and cond.rule_id = outcome.rule_id
400: and cond.rule_id in (
401:
402: select distinct assoc.rule_id from OKC_XPRT_TEMPLATE_RULES assoc, OKC_XPRT_RULE_HDRS_ALL rules
403: where assoc.rule_id = rules.rule_id
404: and assoc.template_id = ' ||l_Template_Id ||
405: ' and rules.status_code in (''ACTIVE'',''PENDINGPUB'',''REVISION'',''PENDINGDISABLE'')
406:
421: ' and rule_id in '||l_request_rule_ids||
422:
423: ' UNION ALL
424:
425: select distinct assoc.rule_id from OKC_XPRT_TEMPLATE_RULES assoc, OKC_XPRT_RULE_HDRS_ALL rules
426: where assoc.rule_id = rules.rule_id
427: and assoc.template_id = ' ||l_Template_Id||
428: ' and rules.rule_id in ' ||l_request_rule_ids||
429:
436: where cond.object_value_type = ''QUESTION''
437: and outcome.object_type = ''QUESTION''
438: and cond.rule_id = outcome.rule_id
439: and cond.rule_id in (
440: select distinct assoc.rule_id from OKC_XPRT_TEMPLATE_RULES assoc, OKC_XPRT_RULE_HDRS_ALL rules
441: where assoc.rule_id = rules.rule_id
442: and assoc.template_id = ' ||l_Template_Id||
443: ' and rules.status_code in (''ACTIVE'',''PENDINGPUB'',''REVISION'',''PENDINGDISABLE'')
444:
459: ' and rule_id in ' ||l_request_rule_ids||
460:
461: ' UNION ALL
462:
463: select distinct assoc.rule_id from OKC_XPRT_TEMPLATE_RULES assoc, OKC_XPRT_RULE_HDRS_ALL rules
464: where assoc.rule_id = rules.rule_id
465: and assoc.template_id = ' ||l_Template_Id||
466: ' and rules.rule_id in ' ||l_request_rule_ids||
467:
2068: WHERE rule_id = p_rule_id;
2069:
2070: CURSOR csr_rule_templates IS
2071: SELECT 'x'
2072: FROM okc_xprt_template_rules
2073: WHERE rule_id = p_rule_id
2074: AND NVL(deleted_flag,'N') = 'N' ;
2075:
2076: l_api_name CONSTANT VARCHAR2(30) := 'check_rule_templates';