[Home] [Help]
1548: ) IS
1549:
1550: cursor c_qualify_conds is
1551: select distinct cond.query_condition_id cond_id
1552: from AMS_QUERY_CONDITION cond, AMS_QUERY_COND_DISP_STRUCT_all struct,
1553: AMS_COND_STRUCT_RESTRICT_VALUE res_values
1554: where cond.template_id = p_template_id
1555: and cond.value1_type = 'LOV'
1556: and struct.QUERY_CONDITION_ID = cond.query_condition_id
1558: and struct.token_type= 'OPERATOR'
1559: and cond.mandatory_flag = 'Y'
1560: UNION
1561: select distinct cond.query_condition_id cond_id
1562: from AMS_QUERY_CONDITION cond, AMS_QUERY_COND_DISP_STRUCT_all struct,
1563: AMS_COND_STRUCT_RESTRICT_VALUE res_values
1564: where cond.template_id = p_template_id
1565: and cond.value1_type = 'LOV'
1566: and struct.QUERY_CONDITION_ID = cond.query_condition_id
1878: ) IS
1879: --Query conditions
1880: CURSOR C_query_cond_main IS
1881: select cond.query_condition_id cond_id, count(*)
1882: from AMS_QUERY_CONDITION cond, AMS_QUERY_COND_DISP_STRUCT_all struct,
1883: AMS_COND_STRUCT_RESTRICT_VALUE res_values
1884: where cond.template_id = p_template_id
1885: and cond.value1_type = 'CONSTANT'
1886: and struct.QUERY_CONDITION_ID = cond.query_condition_id