INSERT FIRST
WHEN policy_type = 'P' THEN
INTO property_premium_fact(policy_id,policy_nbr ,premium_amt)
VALUES (property_premium_seq.nextval,policy_number ,gross_premium)
WHEN p.policy_type = 'C' THEN
INTO property_premium_fact(policy_id,policy_nbr ,premium_amt)
VALUES (property_premium_seq.nextval,policy_number ,gross_premium)
SELECT policy_nbr ,gross_premium ,policy_type
FROM policies
WHERE policy_date >=
TRUNC(SYSDATE,'MM') - TO_YMINTERVAL('00-01');
--By using this multitable INSERT statement instead of two separate statements, the code makes
--a single pass through the policy table instead of two and thus loads the data more efficiently
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/297293/viewspace-594674/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/297293/viewspace-594674/