Addressed #363, assertion error and/or ORA-06502 errors during the quote generation caused by missing Required Meter Size or Qmax in the submitted enquiry.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3975 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-03-12 17:56:39 +00:00
parent dfcd9f4b40
commit 8ee044c2dd
3 changed files with 51 additions and 25 deletions

View File

@@ -4,18 +4,18 @@ CREATE OR REPLACE PACKAGE mip_debug IS
-- Created : 06/03/2008 09:07:01 -- Created : 06/03/2008 09:07:01
-- Purpose : provide debug output functionality -- Purpose : provide debug output functionality
PROCEDURE pl(p_unit IN VARCHAR PROCEDURE pl(p_unit IN VARCHAR2
,p_in VARCHAR2 ,p_in VARCHAR2
,p_line IN NUMBER DEFAULT NULL); ,p_line IN NUMBER DEFAULT NULL);
END mip_debug; END mip_debug;
/ /
CREATE OR REPLACE PACKAGE BODY mip_debug IS CREATE OR REPLACE PACKAGE BODY mip_debug IS
PROCEDURE pl(p_unit IN VARCHAR PROCEDURE pl(p_unit IN VARCHAR2
,p_in VARCHAR2 ,p_in VARCHAR2
,p_line IN NUMBER DEFAULT NULL) IS ,p_line IN NUMBER DEFAULT NULL) IS
l_fh utl_file.file_type; l_fh utl_file.file_type;
l_output VARCHAR2(400); l_output VARCHAR2(4000);
BEGIN BEGIN
dbms_application_info.set_module(p_unit dbms_application_info.set_module(p_unit

View File

@@ -27,7 +27,8 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
-- O-M2 -- O-M2
IF p_rec.enty_code IN ('STD INSTALL', 'STD EXCHANGE') THEN IF p_rec.enty_code IN ('STD INSTALL', 'STD EXCHANGE') THEN
IF p_rec.required_mesc_code = 'OTHER' THEN IF (p_rec.required_mesc_code IS NULL OR
p_rec.required_mesc_code = 'OTHER') THEN
IF p_rec.qmax IS NULL THEN IF p_rec.qmax IS NULL THEN
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
,p_field_name => 'QMAX' ,p_field_name => 'QMAX'
@@ -41,8 +42,7 @@ CREATE OR REPLACE PACKAGE BODY mip_helper_special_cases IS
('INSTALL', 'OFMAT', 'REMOVE', 'ADVERSARIAL', 'ALTERATION', ('INSTALL', 'OFMAT', 'REMOVE', 'ADVERSARIAL', 'ALTERATION',
'CHANGE CAPACITY', 'ADDON', 'OTHER') 'CHANGE CAPACITY', 'ADDON', 'OTHER')
AND p_rec.required_svcp_code = 'IP' AND p_rec.required_svcp_code = 'IP'
AND AND (p_rec.required_ip_details IS NULL) THEN
(p_rec.required_ip_details IS NULL) THEN
mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks mip_mandatory.add_error(p_mandatory_checks => p_mandatory_checks
,p_field_name => 'REQUIRED_SVCP_CODE' ,p_field_name => 'REQUIRED_SVCP_CODE'
,p_error_message => 'Required IP Details must be completed when a Service Pressure of ''IP'' is requested.'); ,p_error_message => 'Required IP Details must be completed when a Service Pressure of ''IP'' is requested.');

View File

@@ -1308,11 +1308,12 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
END return_mandatory_messages; END return_mandatory_messages;
PROCEDURE add_quote_reason(p_enqu_id IN enquiries.id%TYPE PROCEDURE add_quote_reason(p_enqu_id IN enquiries.id%TYPE
,p_reason IN quote_reasoning.reason%TYPE ,p_reason IN VARCHAR2 --quote_reasoning.reason%TYPE
,p_internal_or_external IN quote_reasoning.internal_or_external%TYPE DEFAULT gc_external_reason) IS ,p_internal_or_external IN quote_reasoning.internal_or_external%TYPE DEFAULT gc_external_reason) IS
BEGIN BEGIN
pl('add_quote_reason:' || p_enqu_id || ':' || p_reason pl('add_quote_reason:' || p_enqu_id || ':' || p_reason
,$$PLSQL_LINE); ,$$PLSQL_LINE);
BEGIN
INSERT INTO quote_reasoning INSERT INTO quote_reasoning
(enqu_id (enqu_id
,reason ,reason
@@ -1320,10 +1321,17 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,id) ,id)
VALUES VALUES
(p_enqu_id (p_enqu_id
,p_reason ,substr(p_reason
,1
,239)
,p_internal_or_external ,p_internal_or_external
,qure_seq.NEXTVAL); ,qure_seq.NEXTVAL);
EXCEPTION
WHEN OTHERS THEN
pl('add_quote_reason:' || SQLERRM
,$$PLSQL_LINE);
RAISE;
END;
END add_quote_reason; END add_quote_reason;
FUNCTION get_u_meter_size(p_qmax IN NUMBER) FUNCTION get_u_meter_size(p_qmax IN NUMBER)
@@ -2068,7 +2076,9 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
l_existing_rec_metr_details.mety_code || ':' || l_existing_rec_metr_details.mety_code || ':' ||
l_existing_rec_metr_details.prty_id l_existing_rec_metr_details.prty_id
,$$PLSQL_LINE); ,$$PLSQL_LINE);
add_quote_reason('Existing meter details. Meter model is ' ||
add_quote_reason(p_enqu.id
,'Existing meter details. Meter model is ' ||
nvl(l_existing_rec_metr_details.code nvl(l_existing_rec_metr_details.code
,'UNKNOWN') || ', meter size code is ' || ,'UNKNOWN') || ', meter size code is ' ||
nvl(l_existing_rec_metr_details.mesc_code nvl(l_existing_rec_metr_details.mesc_code
@@ -2088,7 +2098,19 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
IF p_enqu.required_svcp_code = 'LP' IF p_enqu.required_svcp_code = 'LP'
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
-- no restrictions -- no restrictions
pl('Existing LP Diaphragm - no restriction'
,$$PLSQL_LINE);
pl('Required Meter Size' || p_enqu.required_mesc_code
,$$PLSQL_LINE);
pl('Required Qmax' || p_enqu.qmax
,$$PLSQL_LINE);
IF p_enqu.required_mesc_code IS NOT NULL
AND p_enqu.required_mesc_code <> 'OTHER' THEN
l_required_qmax := get_qmax_from_mesc(p_enqu.required_mesc_code);
ELSE
l_required_qmax := p_enqu.qmax; l_required_qmax := p_enqu.qmax;
END IF;
ELSIF p_enqu.required_svcp_code = 'MP' ELSIF p_enqu.required_svcp_code = 'MP'
AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN AND l_existing_rec_metr_details.mety_code = 'DIAPHRAGM' THEN
-- can quote for specific meter size -- can quote for specific meter size
@@ -2123,6 +2145,10 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,'Site Survey is required for exchange of meter.'); ,'Site Survey is required for exchange of meter.');
END IF; END IF;
ELSE ELSE
pl('required_mesc_code=' || p_enqu.required_mesc_code
,$$PLSQL_UNIT);
pl('qmax=' || p_enqu.qmax
,$$PLSQL_UNIT);
-- the user can only request meter sizes of: -- the user can only request meter sizes of:
-- 'U' meter size code, these have associated Qmax values; OR -- 'U' meter size code, these have associated Qmax values; OR
-- 'OTHER' - the user didn't know the meter size code! -- 'OTHER' - the user didn't know the meter size code!