telsale-management/代码/oracle/项目//telsale_policy_check_pkg.pck

50 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-06-21 03:36:18 +00:00
CREATE OR REPLACE PACKAGE telsale_policy_check_pkg IS
-- Author : <20><><EFBFBD><EFBFBD>
-- Created : 2021/6/21 10:18:01
-- Purpose : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤
FUNCTION policy_check(a_policy_no VARCHAR2) RETURN BOOLEAN;
FUNCTION staff_check(a_stuff_code VARCHAR2) RETURN BOOLEAN;
END telsale_policy_check_pkg;
/
CREATE OR REPLACE PACKAGE BODY telsale_policy_check_pkg IS
FUNCTION staff_check(a_stuff_code VARCHAR2) RETURN BOOLEAN IS
l_count INTEGER;
BEGIN
SELECT COUNT(*)
INTO l_count
FROM idst0.rydm_t@xmcx1.cpicxm ry
WHERE ry.staff_code = a_stuff_code;
IF l_count = 0
THEN
RETURN FALSE;
END IF;
RETURN TRUE;
END;
FUNCTION policy_check(a_policy_no VARCHAR2) RETURN BOOLEAN IS
l_count INTEGER;
BEGIN
SELECT COUNT(*)
INTO l_count
FROM idst0.auto_agreement_t@xmcx1.cpicxm a
WHERE a.policy_no = a_policy_no;
IF l_count = 0
THEN
RETURN FALSE;
END IF;
RETURN TRUE;
END;
BEGIN
NULL;
END telsale_policy_check_pkg;
/