The following lines contain the word 'select', 'insert', 'update' or 'delete':
| 22-JUN-2003 K.Boussema Updated error messages |
| 17-JUL-2003 K.Boussema Reviewd the code |
| 23-FEB-2004 K.Boussema Made changes for the FND_LOG. |
| 17-MAR-2004 K.Boussema Reviewed GetPADHashId to handle multiple AADs|
| with the same name (same product_rule_code) |
| 22-MAR-2004 K.Boussema Added a parameter p_module to the TRACE calls|
| and the procedure. |
| 11-MAY-2004 K.Boussema Removed the call to XLA trace routine from |
| trace() procedure |
| 24-JUN-2005 K.Boussema Redefined the GetPADHashId function as an |
| autonomous transaction |
| 26-JUN-2005 W.Chan Add application_id and product_rule_type_code |
| when looking up the hash id for the aad. |
| 12-AUG-2005 W.Chan bug 4549711 - Redefined the GetPADHashId |
| function as an non-autonomous transaction |
| 31-AUG-2005 W.Chan bug 4585458 - Fix GetPADHashId to not to |
| update the xla_product_rules_b with |
| product_rule_hash_id if one is not found |
+===========================================================================*/
--
--
--
--=============================================================================
-- *********** Local Trace Routine **********
--=============================================================================
C_LEVEL_STATEMENT CONSTANT NUMBER := FND_LOG.LEVEL_STATEMENT;
(p_msg => 'SQL - select from xla_product_rules_b'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
SELECT DISTINCT product_rule_hash_id
INTO l_HashID
FROM xla_product_rules_b
WHERE product_rule_code = p_product_rule_code
AND amb_context_code = p_amb_context_code
AND application_id = p_application_id
AND product_rule_type_code = p_product_rule_type_code
AND product_rule_hash_id IS NOT NULL
;
(p_msg => 'SQL - update xla_product_rules_b'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
UPDATE xla_product_rules_b xprb
SET xprb.product_rule_hash_id = (SELECT NVL(MAX(xpr.product_rule_hash_id),0) + 1
FROM xla_product_rules_b xpr)
WHERE xprb.amb_context_code = p_amb_context_code
AND xprb.product_rule_code = p_product_rule_code
AND xprb.application_id = p_application_id
AND xprb.product_rule_type_code = p_product_rule_type_code
RETURNING xprb.product_rule_hash_id INTO l_HashID
;
SELECT NVL(MAX(product_rule_hash_id),0) + 1
INTO l_HashID
FROM xla_product_rules_b;
SELECT xla_prod_rule_hash_s.nextval
INTO l_HashID
FROM dual;
SELECT product_rule_hash_id
INTO p_product_rule_hash_id
FROM xla_product_rules_b
WHERE product_rule_code = p_product_rule_code
AND product_rule_type_code = p_product_rule_type_code
AND application_id = p_application_id
AND amb_context_code = p_amb_context_code
;
SELECT xprt.name
INTO l_pad_name
FROM xla_product_rules_tl xprt
WHERE xprt.application_id = p_application_id
AND xprt.product_rule_code = p_product_rule_code
AND xprt.product_rule_type_code = p_product_rule_type_code
AND xprt.amb_context_code = p_amb_context_code
AND nvl(xprt.language ,USERENV('LANG')) = USERENV('LANG')
;