get enquiry role, forgot to commit

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3242 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
PriestJ
2008-01-15 11:24:00 +00:00
parent eb64acbad1
commit c66351616c

View File

@@ -7,6 +7,8 @@ CREATE OR REPLACE PACKAGE mip_enquiry IS
--
-- Public function and procedure declarations
FUNCTION get_enquiry_role(p_enquiryid IN NUMBER
,p_rolecode IN VARCHAR2) RETURN NUMBER;
FUNCTION set_enquiry_role(p_enquiryid IN NUMBER
,p_partyid IN NUMBER
,p_rolecode IN VARCHAR2) RETURN BOOLEAN;
@@ -52,6 +54,32 @@ CREATE OR REPLACE PACKAGE mip_enquiry IS
END mip_enquiry;
/
CREATE OR REPLACE PACKAGE BODY mip_enquiry IS
/*
FUNCTION get_enquiry_role
- This function finds the enquiry and the role specified and returns the
- latest(current) user id for the specifed role
%param p_enquiryid - the enquiry we want to find the role from.
%param p_rolecode - the type of role we want to find
%return number - the party id of the party that currently assumes the specified role
*/
FUNCTION get_enquiry_role(p_enquiryid IN NUMBER
,p_rolecode IN VARCHAR2) RETURN NUMBER AS
-- cursor to get the current enquiry
CURSOR c_get_enquiry_role(cp_enqu_id number, cp_rolecode VARCHAR2) IS
SELECT prty_id
FROM v_latest_rt_code_for_enro
WHERE rt_code=cp_rolecode and enqu_id=cp_enqu_id;
l_enqu_role_row number;
BEGIN
IF NOT c_get_enquiry_role%ISOPEN THEN
OPEN c_get_enquiry_role(p_enquiryid, p_rolecode);
END IF;
FETCH c_get_enquiry_role
INTO l_enqu_role_row;
CLOSE c_get_enquiry_role;
return l_enqu_role_row;
END get_enquiry_role;
/*
FUNCTION set_enquiry_role
- gets the enquiry id, party id and the role type and writes a record in the enquiry_roles table