The following lines contain the word 'select', 'insert', 'update' or 'delete':
'SELECT ppt.payment_term_id,
ppt.normalize,
pl.lease_num,
ppt.org_id,
ppt.distribution_set_id,
ppt.project_id,
pl.lease_class_code
FROM pn_payment_terms ppt,
pn_tenancies_all pt,
pn_locations_all pln,
pn_leases_all pl
WHERE ppt.lease_id = pl.lease_id
AND pt.lease_id (+) = pl.lease_id
AND pt.location_id = pln.location_id (+)
AND pt.primary_flag (+) = :x_primary_flag
AND SYSDATE between NVL(pt.occupancy_date,SYSDATE)
AND NVL(pt.expiration_date,
TO_DATE(''12/31/4712'',''mm/dd/yyyy''))
AND pl.lease_class_code = NVL(:x_lease_class,pl.lease_class_code)';
SELECT'Y'
FROM dual
WHERE EXISTS (SELECT NULL
FROM pn_distributions_all
WHERE payment_term_id = p_payment_term_id
AND account_class = p_accnt_class);
SELECT org_id FROM pn_payment_terms_all WHERE payment_term_ID = p_payment_term_id;
SELECT NVL(MAX (line_number),0) + 1
INTO l_line_number
FROM pn_distributions_all
WHERE payment_term_id = p_payment_term_id;
l_context := 'inserting INTO dist.';
INSERT INTO pn_distributions_all (distribution_id,
payment_term_id,
account_id,
account_class,
percentage,
line_number,
last_update_date,
last_update_login,
last_updated_by,
creation_date,
created_by,
org_id)
VALUES (pn_distributions_s.nextval,
p_payment_term_id,
p_accnt_ccid,
p_accnt_class,
p_percent,
l_line_number,
SYSDATE,
FND_GLOBAL.LOGIN_ID,
FND_GLOBAL.USER_ID,
SYSDATE,
FND_GLOBAL.USER_ID,
l_org_ID);
pnp_debug_pkg.log('Inserted INTO pn_distributions ...' );
l_context := 'done inserting INTO dist.';