Address #303 - removed <br> from friendly constraint messages.

Amend Qmax values defined within MESC.ctl
Fix bulk_load errors related to loading drawings through MIP_FILES
Amend mip_quotation to produce labour costs where meter size or service pressure is not a cost constraint.
Amend mip_quotation email messages.
Perform additional compilations during install to account for dependency links.
Make meter dimensions optional (mip.tab)

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3721 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-02-26 17:54:21 +00:00
parent c3e754f7da
commit 1f0c8e4f90
12 changed files with 621 additions and 504 deletions

View File

@@ -11,12 +11,12 @@ code
,valid_for_new_meter ,valid_for_new_meter
) )
BEGINDATA BEGINDATA
U16|U16|12.8|YES|YES U16|U16|16|YES|YES
U25|U25|20|YES|YES U25|U25|25|YES|YES
U40|U40|32|YES|YES U40|U40|40|YES|YES
U65|U65|52|YES|YES U65|U65|65|YES|YES
U100|U100|80|YES|YES U100|U100|100|YES|YES
U160|U160|128|YES|YES U160|U160|160|YES|YES
Rotary/Turbine 2inch|Rotary/Turbine 2inch|999|YES|NO Rotary/Turbine 2inch|Rotary/Turbine 2inch|999|YES|NO
Rotary/Turbine 3inch|Rotary/Turbine 3inch|9999|YES|NO Rotary/Turbine 3inch|Rotary/Turbine 3inch|9999|YES|NO
Rotary/Turbine 4inch|Rotary/Turbine 4inch|99999|YES|NO Rotary/Turbine 4inch|Rotary/Turbine 4inch|99999|YES|NO

View File

@@ -40,7 +40,7 @@ COST_MODU_FK|Application Error: Attempting to violate foreign key constraint COS
COST_PK|Attempting to create a duplicate Costs entry COST_PK|Attempting to create a duplicate Costs entry
COST_REGI_FK|Application Error: Attempting to violate foreign key constraint COST_REGI_FK. Please report this error to Advantica. COST_REGI_FK|Application Error: Attempting to violate foreign key constraint COST_REGI_FK. Please report this error to Advantica.
COST_SVCPT_FK|Application Error: Attempting to violate foreign key constraint COST_SVCPT_FK. Please report this error to Advantica. COST_SVCPT_FK|Application Error: Attempting to violate foreign key constraint COST_SVCPT_FK. Please report this error to Advantica.
COST_UK|Attempting to create a duplicate Costs entry. <br>Labour costs should be unique across enquiry type, service pressure, meter size, meter type, valid from and region. <br>Costs for modules, housings, bases and additional items should be unique across valid from and region. COST_UK|Attempting to create a duplicate Costs entry. Labour costs should be unique across enquiry type, service pressure, meter size, meter type, valid from and region. Costs for modules, housings, bases and additional items should be unique across valid from and region.
DIR_ENTY_FK|Application Error: Attempting to violate foreign key constraint DIR_ENTY_FK. Please report this error to Advantica. DIR_ENTY_FK|Application Error: Attempting to violate foreign key constraint DIR_ENTY_FK. Please report this error to Advantica.
DIR_PK|Attempting to create a duplicate Data_Item_Roles entry DIR_PK|Attempting to create a duplicate Data_Item_Roles entry
DOCU_PK|Attempting to create a duplicate Documents entry DOCU_PK|Attempting to create a duplicate Documents entry

View File

@@ -1,38 +1,39 @@
create or replace package MIP_FILES is CREATE OR REPLACE PACKAGE mip_files IS
-- Author : PRIESTJ -- Author : PRIESTJ
-- Created : 02/11/2007 10:59:52 -- Created : 02/11/2007 10:59:52
-- Purpose : Handle files for the webMIP system -- Purpose : Handle files for the webMIP system
-- Public function and procedure declarations -- Public function and procedure declarations
function quote_file_exists(p_qute_id number) return boolean; FUNCTION quote_file_exists(p_qute_id NUMBER) RETURN BOOLEAN;
function delete_file(p_id number,p_doc_status varchar2,p_reason varchar2) return boolean; FUNCTION delete_file(p_id NUMBER
function drawing_file_exists(p_drwg_code varchar2) return boolean; ,p_doc_status VARCHAR2
function update_file_association(p_uri in varchar2, ,p_reason VARCHAR2) RETURN BOOLEAN;
p_description in varchar2, FUNCTION drawing_file_exists(p_drwg_code VARCHAR2) RETURN BOOLEAN;
p_docu_type in varchar2, FUNCTION update_file_association(p_uri IN VARCHAR2
p_qute_id in number, ,p_description IN VARCHAR2
p_enqu_id in number, ,p_docu_type IN VARCHAR2
p_drwg_code in varchar2) return boolean; ,p_qute_id IN NUMBER
function set_file_association(p_uri in varchar2, ,p_enqu_id IN NUMBER
p_description in varchar2, ,p_drwg_code IN VARCHAR2) RETURN BOOLEAN;
p_docu_type in varchar2, FUNCTION set_file_association(p_uri IN VARCHAR2
p_rt_code in varchar2, ,p_description IN VARCHAR2
p_qute_id in number, ,p_docu_type IN VARCHAR2
p_enqu_id in number, ,p_rt_code IN VARCHAR2
p_drwg_code in varchar2, ,p_qute_id IN NUMBER
p_doro_type in varchar2) return boolean; ,p_enqu_id IN NUMBER
,p_drwg_code IN VARCHAR2
,p_doro_type IN VARCHAR2) RETURN BOOLEAN;
PROCEDURE export_table_to_csv(p_table IN VARCHAR2, PROCEDURE export_table_to_csv(p_table IN VARCHAR2
p_column_headers IN VARCHAR2, ,p_column_headers IN VARCHAR2
p_delimiter IN VARCHAR2 DEFAULT ','); ,p_delimiter IN VARCHAR2 DEFAULT ',');
END mip_files;
end MIP_FILES;
/ /
create or replace package body MIP_FILES as CREATE OR REPLACE PACKAGE BODY mip_files AS
PROCEDURE pl(p_in VARCHAR2) IS PROCEDURE pl(p_in VARCHAR2) IS
l_fh utl_file.file_type; l_fh utl_file.file_type;
BEGIN BEGIN
dbms_application_info.set_module('MIP_FILES' dbms_application_info.set_module('MIP_FILES'
@@ -46,27 +47,26 @@ PROCEDURE pl(p_in VARCHAR2) IS
utl_file.fclose(l_fh); utl_file.fclose(l_fh);
END pl; END pl;
/* /*
FUNCTION is_file_over_size_limit FUNCTION is_file_over_size_limit
- takes the uri of the file to test for size and returns true if the file - takes the uri of the file to test for size and returns true if the file
- is over 3 meg (3145728 bytes) in size - is over 3 meg (3145728 bytes) in size
%param p_uri - the uri of the file %param p_uri - the uri of the file
*/ */
function is_file_over_size_limit(p_uri varchar2) return boolean is FUNCTION is_file_over_size_limit(p_uri VARCHAR2) RETURN BOOLEAN IS
l_file_size wwv_flow_files.doc_size%type; l_file_size wwv_flow_files.doc_size%TYPE;
BEGIN BEGIN
pl('is_file_over_size_limit:'||p_uri); pl('is_file_over_size_limit:' || p_uri);
SELECT doc_size SELECT doc_size
INTO l_file_size INTO l_file_size
FROM wwv_flow_files FROM wwv_flow_files
WHERE NAME = p_uri; WHERE NAME = p_uri;
pl('l_file_size:'||l_file_size); pl('l_file_size:' || l_file_size);
RETURN(l_file_size > 3 * 1024 * 1024); RETURN(l_file_size > 3 * 1024 * 1024);
end is_file_over_size_limit; END is_file_over_size_limit;
/* /*
FUNCTION are_files_over_size_limit FUNCTION are_files_over_size_limit
- takes the enquiry id and an additional uri of the file to test for size - takes the enquiry id and an additional uri of the file to test for size
@@ -74,23 +74,24 @@ pl('l_file_size:'||l_file_size);
- by the uri are over 10 meg (10485760 bytes) in size - by the uri are over 10 meg (10485760 bytes) in size
%param p_enqu_id - id of the enquiry to check the files for %param p_enqu_id - id of the enquiry to check the files for
*/ */
function are_files_over_size_limit(p_enqu_id NUMBER) return boolean is FUNCTION are_files_over_size_limit(p_enqu_id NUMBER) RETURN BOOLEAN IS
l_total_size number; l_total_size NUMBER;
BEGIN BEGIN
pl('are_files_over_size_limit:'||p_enqu_id); pl('are_files_over_size_limit:' || p_enqu_id);
SELECT SUM(doc_size) SELECT SUM(doc_size)
INTO l_total_size INTO l_total_size
FROM documents d FROM documents d
,document_roles dr ,document_roles dr
,wwv_flow_files f ,wwv_flow_files f
WHERE dr.enqu_id = p_enqu_id WHERE dr.enqu_id = p_enqu_id
AND d.id = dr.docu_id AND d.id = dr.docu_id
AND d.uri = f.NAME; AND d.uri = f.NAME;
pl('l_total_size:'||l_total_size); pl('l_total_size:' || l_total_size);
RETURN (nvl(l_total_size,0) > 10 * 1024 * 1024); RETURN(nvl(l_total_size
,0) > 10 * 1024 * 1024);
end are_files_over_size_limit;
END are_files_over_size_limit;
/* /*
FUNCTION delete_file FUNCTION delete_file
- takes the id of a file held in the documents table and deletes the associated document - takes the id of a file held in the documents table and deletes the associated document
@@ -99,13 +100,15 @@ pl('l_total_size:'||l_total_size);
%param p_doc_status - the new status of the document one of "REMOVED USER", "REMOVED MALICIOUS", "REMOVED SIZE" %param p_doc_status - the new status of the document one of "REMOVED USER", "REMOVED MALICIOUS", "REMOVED SIZE"
%param p_reason - a description of what the reason for deleting the file is %param p_reason - a description of what the reason for deleting the file is
*/ */
function delete_file(p_id number,p_doc_status varchar2,p_reason varchar2) return boolean is FUNCTION delete_file(p_id NUMBER
l_uri documents.uri%type; ,p_doc_status VARCHAR2
CURSOR c_get_uri(cp_id number) is ,p_reason VARCHAR2) RETURN BOOLEAN IS
select uri l_uri documents.uri%TYPE;
from documents CURSOR c_get_uri(cp_id NUMBER) IS
where id=cp_id; SELECT uri
begin FROM documents
WHERE id = cp_id;
BEGIN
IF NOT c_get_uri%ISOPEN THEN IF NOT c_get_uri%ISOPEN THEN
OPEN c_get_uri(p_id); OPEN c_get_uri(p_id);
END IF; END IF;
@@ -113,70 +116,83 @@ pl('l_total_size:'||l_total_size);
INTO l_uri; INTO l_uri;
CLOSE c_get_uri; CLOSE c_get_uri;
--set up a deletion event for the document --set up a deletion event for the document
insert into document_events(docu_id, dost_code,event_date,description,id) INSERT INTO document_events
values (p_id, (docu_id
p_doc_status, ,dost_code
sysdate, ,event_date
p_reason, ,description
doev_seq.NEXTVAL); ,id)
VALUES
(p_id
,p_doc_status
,SYSDATE
,p_reason
,doev_seq.NEXTVAL);
--delete the actual file from the database --delete the actual file from the database
delete wwv_flow_files where wwv_flow_files.name = l_uri; DELETE wwv_flow_files
return true; WHERE wwv_flow_files.NAME = l_uri;
end delete_file; RETURN TRUE;
/* END delete_file;
/*
FUNCTION quote_file_exists FUNCTION quote_file_exists
- takes the quote id and searches for associated file in APEX Application - takes the quote id and searches for associated file in APEX Application
- Files, returns true if the file exists or false if it does not exist - Files, returns true if the file exists or false if it does not exist
%param p_qute_id - the quote id %param p_qute_id - the quote id
*/ */
function quote_file_exists(p_qute_id number) return boolean is FUNCTION quote_file_exists(p_qute_id NUMBER) RETURN BOOLEAN IS
l_file_exists number; l_file_exists NUMBER;
CURSOR c_file_exists(cp_qute_id number) IS CURSOR c_file_exists(cp_qute_id NUMBER) IS
select 1 SELECT 1
from wwv_flow_files FROM wwv_flow_files
where name=(select d.uri WHERE NAME = (SELECT d.uri
from documents d, document_roles dr FROM documents d
where dr.qute_id = cp_qute_id and d.id = dr.docu_id); ,document_roles dr
begin WHERE dr.qute_id = cp_qute_id
AND d.id = dr.docu_id);
BEGIN
IF NOT c_file_exists%ISOPEN THEN IF NOT c_file_exists%ISOPEN THEN
OPEN c_file_exists(p_qute_id); OPEN c_file_exists(p_qute_id);
END IF; END IF;
FETCH c_file_exists FETCH c_file_exists
INTO l_file_exists; INTO l_file_exists;
CLOSE c_file_exists; CLOSE c_file_exists;
if l_file_exists is not null and l_file_exists>0 then IF l_file_exists IS NOT NULL
return true; AND l_file_exists > 0 THEN
else RETURN TRUE;
return false; ELSE
end if; RETURN FALSE;
end quote_file_exists; END IF;
END quote_file_exists;
/* /*
FUNCTION drawing_file_exists FUNCTION drawing_file_exists
- takes the drawing code and searches for associated file in APEX Application - takes the drawing code and searches for associated file in APEX Application
- Files, returns true if the file exists or false if it does not exist - Files, returns true if the file exists or false if it does not exist
%param p_drwg_code - the drawing code %param p_drwg_code - the drawing code
*/ */
function drawing_file_exists(p_drwg_code varchar2) return boolean is FUNCTION drawing_file_exists(p_drwg_code VARCHAR2) RETURN BOOLEAN IS
l_file_exists number; l_file_exists NUMBER;
CURSOR c_file_exists(cp_drwg_code varchar2) IS CURSOR c_file_exists(cp_drwg_code VARCHAR2) IS
select 1 SELECT 1
from wwv_flow_files FROM wwv_flow_files
where name=(select d.uri WHERE NAME = (SELECT d.uri
from documents d, document_roles dr FROM documents d
where dr.drwg_code = cp_drwg_code and d.id = dr.docu_id); ,document_roles dr
begin WHERE dr.drwg_code = cp_drwg_code
AND d.id = dr.docu_id);
BEGIN
IF NOT c_file_exists%ISOPEN THEN IF NOT c_file_exists%ISOPEN THEN
OPEN c_file_exists(p_drwg_code); OPEN c_file_exists(p_drwg_code);
END IF; END IF;
FETCH c_file_exists FETCH c_file_exists
INTO l_file_exists; INTO l_file_exists;
CLOSE c_file_exists; CLOSE c_file_exists;
if l_file_exists is not null and l_file_exists>0 then IF l_file_exists IS NOT NULL
return true; AND l_file_exists > 0 THEN
else RETURN TRUE;
return false; ELSE
end if; RETURN FALSE;
end drawing_file_exists; END IF;
END drawing_file_exists;
/* /*
FUNCTION update_file_association FUNCTION update_file_association
- updates the association between a object within webmip to a file held in the - updates the association between a object within webmip to a file held in the
@@ -189,35 +205,52 @@ pl('l_total_size:'||l_total_size);
%param p_enqu_id - the enquiry id if applicable otherwise supply null %param p_enqu_id - the enquiry id if applicable otherwise supply null
%param p_drwg_code - the drawing code if applicable otherwise supply null %param p_drwg_code - the drawing code if applicable otherwise supply null
*/ */
function update_file_association(p_uri in varchar2, FUNCTION update_file_association(p_uri IN VARCHAR2
p_description in varchar2, ,p_description IN VARCHAR2
p_docu_type in varchar2, ,p_docu_type IN VARCHAR2
p_qute_id in number, ,p_qute_id IN NUMBER
p_enqu_id in number, ,p_enqu_id IN NUMBER
p_drwg_code in varchar2) return boolean is ,p_drwg_code IN VARCHAR2) RETURN BOOLEAN IS
l_doc_id number; l_doc_id NUMBER;
begin BEGIN
--reference it in the documents table --reference it in the documents table
insert into documents( uri, description, id, docu_type ) INSERT INTO documents
values (p_uri, (uri
p_description, ,description
docu_seq.NEXTVAL, ,id
p_docu_type) ,docu_type)
returning id into l_doc_id; VALUES
--set up a role for the document (p_uri
update document_roles set docu_id = l_doc_id ,p_description
where drwg_code = nvl(p_drwg_code,'') or qute_id = nvl(p_qute_id,0) or enqu_id = nvl(p_enqu_id,0); ,docu_seq.NEXTVAL
--set up an event for the document ,p_docu_type)
insert into document_events(docu_id, dost_code,event_date,description,id) RETURNING id INTO l_doc_id;
values (l_doc_id, --set up a role for the document
'AWAIT SCAN', UPDATE document_roles
sysdate, SET docu_id = l_doc_id
p_description, WHERE drwg_code = nvl(p_drwg_code
doev_seq.NEXTVAL); ,'')
--if it works then return true OR qute_id = nvl(p_qute_id
return true; ,0)
end update_file_association; OR enqu_id = nvl(p_enqu_id
,0);
--set up an event for the document
INSERT INTO document_events
(docu_id
,dost_code
,event_date
,description
,id)
VALUES
(l_doc_id
,'AWAIT SCAN'
,SYSDATE
,p_description
,doev_seq.NEXTVAL);
--if it works then return true
RETURN TRUE;
END update_file_association;
/* /*
FUNCTION set_file_association FUNCTION set_file_association
- sets the association between a object within webmip to a file held in the - sets the association between a object within webmip to a file held in the
@@ -231,55 +264,83 @@ pl('l_total_size:'||l_total_size);
%param p_drwg_code - the drawing code if applicable otherwise supply null %param p_drwg_code - the drawing code if applicable otherwise supply null
%param p_doro_type - DRRO (for a drawing), ENDO (for an enquiry), QUDO (for a quote) %param p_doro_type - DRRO (for a drawing), ENDO (for an enquiry), QUDO (for a quote)
*/ */
function set_file_association(p_uri in varchar2, FUNCTION set_file_association(p_uri IN VARCHAR2
p_description in varchar2, ,p_description IN VARCHAR2
p_docu_type in varchar2, ,p_docu_type IN VARCHAR2
p_rt_code in varchar2, ,p_rt_code IN VARCHAR2
p_qute_id in number, ,p_qute_id IN NUMBER
p_enqu_id in number, ,p_enqu_id IN NUMBER
p_drwg_code in varchar2, ,p_drwg_code IN VARCHAR2
p_doro_type in varchar2) return BOOLEAN is ,p_doro_type IN VARCHAR2) RETURN BOOLEAN IS
l_doc_id number; l_doc_id NUMBER;
l_success boolean; l_success BOOLEAN;
BEGIN BEGIN
pl('set_file_association, p_uri='||p_uri||', p_drwg_code='||p_drwg_code); pl('set_file_association, p_uri=' || p_uri || ', p_drwg_code=' ||
--reference it in the documents table p_drwg_code);
insert into documents( uri, description, id, docu_type ) --reference it in the documents table
values (p_uri, INSERT INTO documents
p_description, (uri
docu_seq.NEXTVAL, ,description
p_docu_type) ,id
returning id into l_doc_id; ,docu_type)
--set up a role for the document VALUES
insert into document_roles(rt_code, start_date,description,qute_id,enqu_id,drwg_code,id,doro_type,docu_id) (p_uri
values (p_rt_code, ,p_description
sysdate, ,docu_seq.NEXTVAL
p_description, ,p_docu_type)
p_qute_id, RETURNING id INTO l_doc_id;
p_enqu_id, --set up a role for the document
p_drwg_code, INSERT INTO document_roles
doro_seq.NEXTVAL, (rt_code
p_doro_type, ,start_date
l_doc_id); ,description
--set up an event for the document ,qute_id
insert into document_events(docu_id, dost_code,event_date,description,id) ,enqu_id
values (l_doc_id, ,drwg_code
'AWAIT SCAN', ,id
sysdate, ,doro_type
p_description, ,docu_id)
doev_seq.NEXTVAL); VALUES
(p_rt_code
pl('check_file_sizes'); ,SYSDATE
if (are_files_over_size_limit(p_enqu_id) or is_file_over_size_limit(p_uri)) and p_rt_code = 'ENQUIRY SUPPORTING DOC' and not p_enqu_id is null then ,p_description
l_success := delete_file(l_doc_id,'REMOVED SIZE','webMIP determined the file or files to be too big'); ,p_qute_id
pl('returning false'); ,p_enqu_id
return false; ,p_drwg_code
else ,doro_seq.NEXTVAL
--if it works then return true ,p_doro_type
pl('returning true'); ,l_doc_id);
return true; --set up an event for the document
end if; INSERT INTO document_events
end set_file_association; (docu_id
,dost_code
,event_date
,description
,id)
VALUES
(l_doc_id
,'AWAIT SCAN'
,SYSDATE
,p_description
,doev_seq.NEXTVAL);
pl('check_file_sizes');
IF p_rt_code = 'ENQUIRY SUPPORTING DOC'
AND NOT p_enqu_id IS NULL THEN
IF (are_files_over_size_limit(p_enqu_id) OR
is_file_over_size_limit(p_uri)) THEN
l_success := delete_file(l_doc_id
,'REMOVED SIZE'
,'webMIP determined the file or files to be too big');
pl('returning false');
RETURN FALSE;
END IF;
END IF;
--if it works then return true
pl('returning true');
RETURN TRUE;
END set_file_association;
/* /*
PROCEDURE export_data_to_csv PROCEDURE export_data_to_csv
- allows an admin user to create a CSV export of a table in webMIP. - allows an admin user to create a CSV export of a table in webMIP.
@@ -289,27 +350,28 @@ pl('l_total_size:'||l_total_size);
%param p_column_headers - tables column names be exported as a header %param p_column_headers - tables column names be exported as a header
%param p_delimiter - what is the delimiter value is for each field (default ',') %param p_delimiter - what is the delimiter value is for each field (default ',')
*/ */
PROCEDURE export_table_to_csv(p_table IN VARCHAR2, PROCEDURE export_table_to_csv(p_table IN VARCHAR2
p_column_headers IN VARCHAR2, ,p_column_headers IN VARCHAR2
p_delimiter IN VARCHAR2 DEFAULT ',') is ,p_delimiter IN VARCHAR2 DEFAULT ',') IS
l_select VARCHAR2(2000); --will hold our dynamically created sql query l_select VARCHAR2(2000); --will hold our dynamically created sql query
l_cursor INTEGER DEFAULT dbms_sql.open_cursor; --a handle for the recordset we can then loop through l_cursor INTEGER DEFAULT dbms_sql.open_cursor; --a handle for the recordset we can then loop through
l_status INTEGER; l_status INTEGER;
l_return VARCHAR2(4000); l_return VARCHAR2(4000);
l_found BOOLEAN := TRUE; l_found BOOLEAN := TRUE;
l_headers VARCHAR(2000); --used to collect the column headers l_headers VARCHAR(2000); --used to collect the column headers
BEGIN BEGIN
dbms_output.put_line('me is here'); dbms_output.put_line('me is here');
-- Build the dynamic SQL statement to get the tables column names -- Build the dynamic SQL statement to get the tables column names
FOR f IN (SELECT column_name FOR f IN (SELECT column_name
FROM user_tab_columns FROM user_tab_columns
WHERE table_name = upper(p_table) WHERE table_name = upper(p_table)
ORDER BY column_id) LOOP ORDER BY column_id) LOOP
-- --
-- AG's clever delimiting ensures that the rows from the table are output -- AG's clever delimiting ensures that the rows from the table are output
-- in a nice CSV format -- in a nice CSV format
l_select := l_select ||'''"''||'|| f.column_name || '||''"'||p_delimiter||'''||'; l_select := l_select || '''"''||' || f.column_name || '||''"' ||
p_delimiter || '''||';
-- --
-- Get the header row, slightly inefficient in that we may not need to -- Get the header row, slightly inefficient in that we may not need to
-- do it every time -- do it every time
@@ -319,14 +381,17 @@ pl('l_total_size:'||l_total_size);
-- --
-- Trim the unnecessary additional delimiting chars on the headers and -- Trim the unnecessary additional delimiting chars on the headers and
-- add a carriage return -- add a carriage return
l_headers := RTRIM(l_headers,p_delimiter) || CHR(13); l_headers := rtrim(l_headers
,p_delimiter) || chr(13);
-- --
-- build the dynamic SQL that will return all the table rows -- build the dynamic SQL that will return all the table rows
l_select := 'SELECT ' || RTRIM(l_select,'||') || CHR(13)||CHR(10) ||' FROM ' || p_table; l_select := 'SELECT ' || rtrim(l_select
,'||') || chr(13) || chr(10) || ' FROM ' ||
p_table;
-- --
-- Now we have the select, let's execute it -- Now we have the select, let's execute it
-- --
dbms_output.put_line(l_select); dbms_output.put_line(l_select);
dbms_sql.parse(l_cursor dbms_sql.parse(l_cursor
,l_select ,l_select
,dbms_sql.native); ,dbms_sql.native);
@@ -336,16 +401,18 @@ pl('l_total_size:'||l_total_size);
,l_return ,l_return
,4000); ,4000);
-- --
l_status := dbms_sql.execute(l_cursor); --could be used for further manipulation l_status := dbms_sql.EXECUTE(l_cursor); --could be used for further manipulation
-- --
WHILE (dbms_sql.fetch_rows(l_cursor) > 0) LOOP WHILE (dbms_sql.fetch_rows(l_cursor) > 0) LOOP
-- --
IF l_found THEN IF l_found THEN
-- --
-- Set the header MIME type -- Set the header MIME type
owa_util.mime_header( 'application/octet', FALSE ); owa_util.mime_header('application/octet'
,FALSE);
-- Set the name of the file -- Set the name of the file
htp.p('Content-Disposition: attachment; filename="'||lower(p_table)||'.csv"'); htp.p('Content-Disposition: attachment; filename="' ||
lower(p_table) || '.csv"');
-- Close the HTTP Header -- Close the HTTP Header
owa_util.http_header_close; owa_util.http_header_close;
-- --
@@ -353,10 +420,10 @@ pl('l_total_size:'||l_total_size);
-- --
-- If the user has requested that the tables column names be exported -- If the user has requested that the tables column names be exported
-- then display them -- then display them
if upper(p_column_headers) = 'YES' then IF upper(p_column_headers) = 'YES' THEN
--print column headers --print column headers
htp.p(l_headers); htp.p(l_headers);
end if; END IF;
-- --
END IF; END IF;
-- --
@@ -371,5 +438,5 @@ pl('l_total_size:'||l_total_size);
-- --
END export_table_to_csv; END export_table_to_csv;
end MIP_FILES; END mip_files;
/ /

View File

@@ -24,9 +24,9 @@ exec gen_mandatory
@@get_quote_items.fnc @@get_quote_items.fnc
@@mip_bulk_Load.pck @@mip_bulk_Load.pck
@@mip_tripartite.pck @@mip_tripartite.pck
@@mip_documents.pck
@@mip_virus_check.pck @@mip_virus_check.pck
@@mip_email.pck @@mip_email.pck
@@mip_friendly_messages.pck @@mip_friendly_messages.pck
@@compile.sql @@compile.sql
@@mip_documents.pck
exit exit

View File

@@ -5,6 +5,8 @@ PROMPT * Compile Schema
exec dbms_utility.compile_schema(USER) exec dbms_utility.compile_schema(USER)
exec dbms_utility.compile_schema(USER)
SET SCAN ON SET SCAN ON
SET DEFINE ON SET DEFINE ON
SET ARRAYSIZE 1 SET ARRAYSIZE 1

View File

@@ -92,7 +92,7 @@ CREATE OR REPLACE PACKAGE BODY mip_friendly_messages IS
l_msg := l_ora_msg; l_msg := l_ora_msg;
END IF; END IF;
htp.prn(l_msg); return(l_msg);
END get_friendly_message; END get_friendly_message;
END mip_friendly_messages; END mip_friendly_messages;

View File

@@ -127,22 +127,20 @@ END mip_quotation;
/ /
CREATE OR REPLACE PACKAGE BODY mip_quotation IS CREATE OR REPLACE PACKAGE BODY mip_quotation IS
-- PROCEDURE email_aq_generated(p_enqu_id IN enquiries.id%TYPE); PROCEDURE email_agent_aq_available(p_enqu_id IN enquiries.id%TYPE);
PROCEDURE email_quotes_available(p_enqu_id IN enquiries.id%TYPE); PROCEDURE email_agent_quote_acceptance(p_enqu_id enquiries.id%TYPE);
PROCEDURE email_rfq_submitted(p_enqu_id IN enquiries.id%TYPE); PROCEDURE email_agent_mq_available(p_enqu_id enquiries.id%TYPE);
-- PROCEDURE email_request_for_mq(p_enqu_id IN enquiries.id%TYPE);
PROCEDURE email_iu_quote_acceptance(p_enqu_id enquiries.id%TYPE);
PROCEDURE email_support(p_subject IN VARCHAR2 PROCEDURE email_support(p_subject IN VARCHAR2
,p_enqu_id IN enquiries.id%TYPE); ,p_enqu_id IN enquiries.id%TYPE);
SUBTYPE t_internal_or_external IS VARCHAR2(8); SUBTYPE t_internal_or_external IS VARCHAR2(8);
gc_internal_reason CONSTANT t_internal_or_external := 'INTERNAL'; gc_internal_reason CONSTANT t_internal_or_external := 'INTERNAL';
gc_external_reason CONSTANT t_internal_or_external := 'EXTERNAL'; gc_external_reason CONSTANT t_internal_or_external := 'EXTERNAL';
SUBTYPE t_manual_or_automatic_quote IS VARCHAR2(2); SUBTYPE t_manual_or_automatic_quote IS VARCHAR2(2);
SUBTYPE t_enqu IS enquiries%ROWTYPE;
gc_manual_quote CONSTANT t_manual_or_automatic_quote := 'MQ'; gc_manual_quote CONSTANT t_manual_or_automatic_quote := 'MQ';
gc_automatic_quote CONSTANT t_manual_or_automatic_quote := 'AQ'; gc_automatic_quote CONSTANT t_manual_or_automatic_quote := 'AQ';
@@ -150,6 +148,16 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
g_email_html_body CLOB; g_email_html_body CLOB;
gc_newline CONSTANT CHAR(2) DEFAULT chr(10) || chr(13); gc_newline CONSTANT CHAR(2) DEFAULT chr(10) || chr(13);
SUBTYPE t_enqu IS enquiries%ROWTYPE;
SUBTYPE t_email_reason IS VARCHAR2(80);
gc_agent_rmq_notification t_email_reason := 'AGENT_RMQ_NOTIFICATION';
gc_agent_qa_notification t_email_reason := 'AGENT_QA_NOTIFICATION';
gc_agent_mqa_notification t_email_reason := 'AGENT_MQA_NOTIFICATION';
gc_internal_qa_notification t_email_reason := 'INTERNAL_QA_NOTIFICATION';
gc_internal_rmq_notification t_email_reason := 'AGENT_RMQ_NOTIFICATION';
TYPE t_rec_additional_costs IS RECORD( TYPE t_rec_additional_costs IS RECORD(
adit_code additional_items.code%TYPE adit_code additional_items.code%TYPE
,svcpt_code service_pressure_types.code%TYPE ,svcpt_code service_pressure_types.code%TYPE
@@ -237,6 +245,7 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
,p_owner_prty_id IN parties.id%TYPE DEFAULT NULL ,p_owner_prty_id IN parties.id%TYPE DEFAULT NULL
,p_description quote_events.description%TYPE DEFAULT NULL ,p_description quote_events.description%TYPE DEFAULT NULL
,p_event_date IN DATE DEFAULT SYSDATE) IS ,p_event_date IN DATE DEFAULT SYSDATE) IS
l_enqu_id enquiries.id%TYPE;
BEGIN BEGIN
add_quote_event(p_qute_id => p_qute_id add_quote_event(p_qute_id => p_qute_id
,p_qust_code => 'ACCEPTED' ,p_qust_code => 'ACCEPTED'
@@ -253,6 +262,15 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
,p_prty_id => p_prty_id ,p_prty_id => p_prty_id
,p_rt_code => 'Q SUBACC' ,p_rt_code => 'Q SUBACC'
,p_start_date => p_event_date); ,p_start_date => p_event_date);
SELECT enqu_id
INTO l_enqu_id
FROM quotes
WHERE id = p_qute_id;
email_agent_quote_acceptance(p_enqu_id => l_enqu_id);
email_iu_quote_acceptance(p_enqu_id => l_enqu_id);
END accept_quote; END accept_quote;
PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE PROCEDURE reject_quote(p_qute_id IN quotes.id%TYPE
@@ -431,6 +449,8 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
END start_quote; END start_quote;
PROCEDURE make_quote_available(p_qute_id IN quotes.id%TYPE) IS PROCEDURE make_quote_available(p_qute_id IN quotes.id%TYPE) IS
l_qute_type quotes.qute_type%TYPE;
l_enqu_id enquiries.id%TYPE;
BEGIN BEGIN
pl('make_quote_available'); pl('make_quote_available');
@@ -438,6 +458,19 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
,p_qust_code => 'AV' ,p_qust_code => 'AV'
,p_event_date => SYSDATE); ,p_event_date => SYSDATE);
SELECT qute_type
,enqu_id
INTO l_qute_type
,l_enqu_id
FROM quotes
WHERE id = p_qute_id;
IF l_qute_type = 'MQ' THEN
email_agent_mq_available(l_enqu_id);
ELSE
email_agent_aq_available(l_enqu_id);
END IF;
END make_quote_available; END make_quote_available;
PROCEDURE mark_enquiry_submitted(p_enqu_id IN enquiries.id%TYPE) IS PROCEDURE mark_enquiry_submitted(p_enqu_id IN enquiries.id%TYPE) IS
@@ -448,7 +481,6 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
,p_enst_code => 'SUBMITTED' ,p_enst_code => 'SUBMITTED'
,p_event_date => SYSDATE); ,p_event_date => SYSDATE);
email_rfq_submitted(p_enqu_id);
END mark_enquiry_submitted; END mark_enquiry_submitted;
PROCEDURE mark_enquiry_quoted(p_enqu_id IN enquiries.id%TYPE) IS PROCEDURE mark_enquiry_quoted(p_enqu_id IN enquiries.id%TYPE) IS
@@ -459,8 +491,6 @@ CREATE OR REPLACE PACKAGE BODY mip_quotation IS
,p_enst_code => 'QUOTED' ,p_enst_code => 'QUOTED'
,p_event_date => SYSDATE); ,p_event_date => SYSDATE);
email_quotes_available(p_enqu_id);
END mark_enquiry_quoted; END mark_enquiry_quoted;
PROCEDURE mark_enquiry_invalid(p_enqu_id IN enquiries.id%TYPE) IS PROCEDURE mark_enquiry_invalid(p_enqu_id IN enquiries.id%TYPE) IS
@@ -723,162 +753,19 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
END produce_reasoning_summary; END produce_reasoning_summary;
/* PROCEDURE email_aq_generated(p_enqu_id IN enquiries.id%TYPE) IS PROCEDURE email_to_agent(p_enqu_id IN enquiries.id%TYPE
,p_email_reason IN t_email_reason) IS
l_agent_prty_id parties.id%TYPE;
l_agent_comt_code contact_mechanism_types.code%TYPE;
l_agent_comt_description contact_mechanism_types.description%TYPE;
l_agent_contact_value contact_mechanisms.contact_value%TYPE;
l_email_subject VARCHAR2(240);
l_email_recipient VARCHAR2(240);
l_agent_first_name parties.first_name%TYPE;
l_agent_last_name parties.last_name%TYPE;
BEGIN BEGIN
open_body; pl('email_to_agent:enter:p_enqu_id=' || p_enqu_id ||
', p_email_reason=' || p_email_reason);
al('Quotations produced in response to Enquiry refererence: ' ||
p_enqu_id || ' (' || get_enty_description(p_enqu_id) || ')');
FOR l_qute IN (SELECT id
FROM quotes
,v_quote_details v
WHERE enqu_id = p_enqu_id
AND v.quote_id = id
ORDER BY total_cost) LOOP
produce_quote_summary(l_qute.id);
al(' ');
END LOOP;
produce_reasoning_summary(p_enqu_id);
close_body;
mip_email.send_email_clob(p_recipient => get_automatic_quote_recipient
,p_body => g_email_plain_body
,p_body_html => g_email_html_body
,p_subject => get_system_name ||
': Notification of generation of automatic quotes for Enquiry reference: ' ||
p_enqu_id);
END email_aq_generated;*/
PROCEDURE email_quotes_available(p_enqu_id IN enquiries.id%TYPE) IS
l_agent_comt_code enquiries.agent_comt_code%TYPE;
l_agent_contact_value enquiries.agent_contact_value%TYPE;
l_email_recipient system_configuration.VALUE%TYPE;
l_email_subject VARCHAR2(240);
l_agent_first_name parties.first_name%TYPE;
l_agent_last_name parties.last_name%TYPE;
l_agent_prty_id parties.id%TYPE;
l_date_submitted DATE;
BEGIN
pl('email_quotes_available');
open_body;
SELECT agent_comt_code
,agent_contact_value
,event_date
INTO l_agent_comt_code
,l_agent_contact_value
,l_date_submitted
FROM enquiries
,enquiry_events
WHERE enquiries.id = p_enqu_id
AND enquiry_events.enqu_id = enquiries.id
AND enquiry_events.enst_code = 'SUBMITTED';
l_agent_prty_id := mip_enquiry.get_enquiry_role(p_enquiryid => p_enqu_id
,p_rolecode => 'ENQ OWN');
SELECT first_name
,last_name
INTO l_agent_first_name
,l_agent_last_name
FROM parties
WHERE id = l_agent_prty_id;
IF l_agent_comt_code = 'EMAIL' THEN
l_email_recipient := l_agent_contact_value;
l_email_subject := get_system_name ||
': Confirmation of availability of quotation(s)';
al('Confirmation of availability of quotation.');
al(' ');
al('Thank you for using ' || get_system_name ||
' online. Your quotation(s) are now available.');
al(' ');
al('Enquiry refererence: ' || p_enqu_id || ' (' ||
get_enty_description(p_enqu_id) || ')');
al('Request made on: ' ||
to_char(l_date_submitted
,'ddth Month YYYY HH24:MI:SS'));
al(' ');
ELSE
l_email_recipient := get_automatic_quote_recipient;
l_email_subject := get_system_name ||
': Confirmation of availability of quotation(s), Agent requires notification.';
al('Enquiry refererence: ' || p_enqu_id || ' (' ||
get_enty_description(p_enqu_id) || ')');
al('Request made on: ' ||
to_char(l_date_submitted
,'ddth Month YYYY HH24:MI:SS'));
al(' ');
al('The Agent, ' || l_agent_first_name || ' ' || l_agent_last_name ||
' has requested that they be contacted via ' || l_agent_comt_code || '(' ||
l_agent_contact_value || ')');
END IF;
al(' ');
al('The following quotations are available:');
FOR l_qute IN (SELECT id
FROM quotes
,v_quote_details v
,v_current_quote_status s
WHERE enqu_id = p_enqu_id
AND v.quote_id = id
AND s.qute_id = id
AND s.qust_code = 'AV'
ORDER BY total_cost) LOOP
produce_quote_summary(l_qute.id);
al(' ');
END LOOP;
close_body;
BEGIN
mip_email.send_email_clob(p_recipient => l_email_recipient
,p_body => g_email_plain_body
,p_body_html => g_email_html_body
,p_subject => l_email_subject);
EXCEPTION
WHEN OTHERS THEN
pl('mip_email.send_email_clob returned ' || SQLERRM);
END;
pl('email_quotes_available:exit');
END email_quotes_available;
PROCEDURE email_rfq_submitted(p_enqu_id IN enquiries.id%TYPE) IS
l_agent_comt_code enquiries.agent_comt_code%TYPE;
l_agent_contact_value enquiries.agent_contact_value%TYPE;
l_email_recipient system_configuration.VALUE%TYPE;
l_email_subject VARCHAR2(240);
l_agent_first_name parties.first_name%TYPE;
l_agent_last_name parties.last_name%TYPE;
l_agent_prty_id parties.id%TYPE;
l_date_submitted DATE;
BEGIN
pl('email_rfq_submitted');
open_body;
SELECT agent_comt_code
,agent_contact_value
,event_date
INTO l_agent_comt_code
,l_agent_contact_value
,l_date_submitted
FROM enquiries
,enquiry_events
WHERE enquiries.id = p_enqu_id
AND enquiry_events.enqu_id = enquiries.id
AND enquiry_events.enst_code = 'SUBMITTED';
BEGIN BEGIN
l_agent_prty_id := mip_enquiry.get_enquiry_role(p_enquiryid => p_enqu_id l_agent_prty_id := mip_enquiry.get_enquiry_role(p_enquiryid => p_enqu_id
,p_rolecode => 'ENQ OWN'); ,p_rolecode => 'ENQ OWN');
@@ -888,55 +775,143 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
RAISE; RAISE;
END; END;
BEGIN SELECT agent_comt_code
,comt.description
,agent_contact_value
INTO l_agent_comt_code
,l_agent_comt_description
,l_agent_contact_value
FROM enquiries
,contact_mechanism_types comt
WHERE enquiries.id = p_enqu_id
AND comt.code = enquiries.agent_comt_code;
open_body;
IF l_agent_comt_code = 'EMAIL' THEN
l_email_recipient := l_agent_contact_value;
ELSE
l_email_recipient := get_automatic_quote_recipient;
SELECT first_name SELECT first_name
,last_name ,last_name
INTO l_agent_first_name INTO l_agent_first_name
,l_agent_last_name ,l_agent_last_name
FROM parties FROM parties
WHERE id = l_agent_prty_id; WHERE id = l_agent_prty_id;
EXCEPTION
WHEN OTHERS THEN
pl('Error finding agent - prty_id=' || l_agent_prty_id);
END;
IF l_agent_comt_code = 'EMAIL' THEN
l_email_recipient := l_agent_contact_value;
l_email_subject := get_system_name ||
': Confirmation of Request for Quotation';
al('Confirmation of Request for Quotation');
al(' ');
al('Thank you for using ' || get_system_name ||
' online. Your request for quotation has been received.');
al(' ');
al('Enquiry Refererence Number: ' || p_enqu_id || ' (' ||
get_enty_description(p_enqu_id) || ')');
al('Request made on: ' ||
to_char(l_date_submitted
,'ddth Month YYYY HH24:MI:SS'));
al(' ');
al('You should receive notification of your quotation(s) within 6 days.');
al(' ');
al('Should notification of your quotation(s) not arrive after 6 days, then please phone us on ' ||
get_customer_support_telephone ||
'. Be prepared to quote the Enquiry Reference Number.');
ELSE
l_email_recipient := get_automatic_quote_recipient;
l_email_subject := get_system_name ||
': Confirmation of Request for Quotation, Agent requires notification.';
al('Enquiry Refererence Number: ' || p_enqu_id || ' (' ||
get_enty_description(p_enqu_id) || ')');
al('Request made on: ' ||
to_char(l_date_submitted
,'ddth Month YYYY HH24:MI:SS'));
al(' ');
al('The Agent, ' || l_agent_first_name || ' ' || l_agent_last_name || al('The Agent, ' || l_agent_first_name || ' ' || l_agent_last_name ||
' has requested that they be contacted via ' || l_agent_comt_code || '(' || ' has requested that they be contacted via ' ||
l_agent_contact_value || ')'); l_agent_comt_description || '(' || l_agent_contact_value || ')');
al(' ');
al('The information to be passed on is:');
al(' '); al(' ');
END IF; END IF;
IF p_email_reason = gc_agent_qa_notification THEN
l_email_subject := get_system_name || ': Quote Acceptance';
al('Dear Sir/Madam,');
al(' ');
al('Enquiry reference number: ' || p_enqu_id);
al(' ');
al('Thank you for accepting National Grid Metering<6E>s quotation using the Online I&C Quotations System. We will acknowledge your acceptance and provide you with a planning letter within the agreed timescales for the work type involved. ');
al(' ');
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
al(' ');
al('For further information or clarity, please do not hesitate to get in contact');
al(' ');
al('Regards');
al(' ');
al('The I&C Non Standard Team');
al('National Grid Metering');
al('Abbotts Lane');
al('Coventry');
al('CV1 4AY');
al(' ');
al('Phone: 02476 286 322');
al('Fax: 02476 286 044');
al('Email: ic.nonstandard1@uk.ngrid.com');
ELSIF p_email_reason = gc_agent_rmq_notification THEN
l_email_subject := get_system_name || ': Request for Manual Quote';
al('Dear Sir/Madam,');
al(' ');
al('Enquiry reference number: ' || p_enqu_id);
al(' ');
al('Thank you for requesting a quotation using the National Grid Metering Online I&C Quotations System. There are no automatic quotations available for this request, and a manual quotation will be prepared and uploaded to the website within the agreed timescales for the work type involved. We will notify you when this quotation is ready for your consideration.');
al(' ');
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
al(' ');
al('Regards');
al(' ');
al('The I&C Non Standard Team');
al('National Grid Metering');
al('Abbotts Lane');
al('Coventry');
al('CV1 4AY');
al(' ');
al('Phone: 02476 286 322');
al('Fax: 02476 286 044');
al('Email: ic.nonstandard1@uk.ngrid.com');
ELSIF p_email_reason = gc_agent_mqa_notification THEN
l_email_subject := get_system_name || ': Manual Quote Available';
al('Dear Sir/Madam,');
al(' ');
al('Enquiry reference number: ' || p_enqu_id);
al(' ');
al('Your quotation is now ready to view on the National Grid Metering I&C Online Quotation System.');
al(' ');
al('Please note that this quotation is valid for 90 days from the date specified in the quotation. To accept this quotation, please submit a work request via IX, complete the acceptance form on the quotation letter, or click the accept button on the Online I&C quotations system. Please note that this quotation is valid for 90 days from the date specified in the quotation.');
al(' ');
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
al(' ');
al('Regards');
al(' ');
al('The I&C Non Standard Team');
al('National Grid Metering');
al('Abbotts Lane');
al('Coventry');
al('CV1 4AY');
al(' ');
al('Phone: 02476 286 322');
al('Fax: 02476 286 044');
al('Email: ic.nonstandard1@uk.ngrid.com');
ELSIF p_email_reason = gc_agent_qa_notification THEN
l_email_subject := get_system_name || ': Automatic Quote Available';
al('Dear Sir/Madam,');
al(' ');
al('Enquiry reference number: ' || p_enqu_id);
al(' ');
al('Thank you for using the National Grid Metering Online I&C quotations system. Your enquiry has generated an automatic quotation. To accept this quotation; either submit a work request via IX, complete the acceptance form on the quotation letter, or click the accept button on the Online I&C quotations system. Please note that this quotation is valid for 90 days from the date specified in the quotation.');
al(' ');
al('The following quotations are available:');
FOR l_qute IN (SELECT id
FROM quotes
,v_quote_details v
,v_current_quote_status s
WHERE enqu_id = p_enqu_id
AND v.quote_id = id
AND s.qute_id = id
AND s.qust_code = 'AV'
ORDER BY total_cost) LOOP
produce_quote_summary(l_qute.id);
al(' ');
END LOOP;
al('Please use the Enquiry reference number at the top of this email on any future correspondence relating to this request.');
al(' ');
al('Regards');
al(' ');
al('The I&C Non Standard Team');
al('National Grid Metering');
al('Abbotts Lane');
al('Coventry');
al('CV1 4AY');
al(' ');
al('Phone: 02476 286 322');
al('Fax: 02476 286 044');
al('Email: ic.nonstandard1@uk.ngrid.com');
END IF;
close_body; close_body;
BEGIN BEGIN
@@ -947,62 +922,131 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
EXCEPTION EXCEPTION
WHEN OTHERS THEN WHEN OTHERS THEN
pl('mip_email.send_email_clob returned ' || SQLERRM); pl('mip_email.send_email_clob returned ' || SQLERRM);
RAISE;
END; END;
END email_rfq_submitted; pl('email_to_agent:exit');
END email_to_agent;
PROCEDURE email_request_for_mq(p_enqu_id IN enquiries.id%TYPE) IS PROCEDURE email_to_internal_users(p_enqu_id IN enquiries.id%TYPE
l_system_name system_configuration.VALUE%TYPE := get_system_name; ,p_email_reason IN t_email_reason) IS
l_quote_row quotes%ROWTYPE; l_email_subject VARCHAR2(240);
l_email_recipient VARCHAR2(240);
l_qute_id quotes.id%TYPE;
BEGIN BEGIN
pl('email_request_for_mq'); pl('email_internal_users:entry:p_enqu_id=' || p_enqu_id ||
', p_email_reason=' || p_email_reason);
SELECT *
INTO l_quote_row
FROM quotes
WHERE enqu_id = p_enqu_id;
open_body; open_body;
IF p_email_reason = gc_internal_qa_notification THEN
al('This email has been produced in response to Enquiry Refererence Number: ' || l_email_subject := get_system_name ||
p_enqu_id || ' (' || get_enty_description(p_enqu_id) || ')'); ': Quote Acceptance Notification';
al('Hi team,');
al(' '); al(' ');
al(l_system_name || al('Enquiry reference number: ' || p_enqu_id);
' was unable to produce an automatic quote for this Enquiry, therefore a ' || al(' ');
'Manual Quote is to be completed against Quote Reference Number: ' || al('Please process this enquiry, as the quotation has been accepted.');
l_quote_row.id); al(' ');
al('This quote will be valid from ' ||
to_char(l_quote_row.valid_from SELECT qute_id
,'ddth Month YYYY') || ' to ' || INTO l_qute_id
to_char(l_quote_row.valid_until FROM quote_events quev
,'ddth Month YYYY')); ,quotes qute
al(' '); WHERE qute.enqu_id = p_enqu_id
al('Current Service Level Agreements dictate that a manual quote be provided within 6 days'); AND quev.qute_id = qute.id
AND quev.qust_code = 'ACCEPTED';
al('Data Entered:');
produce_enquiry_entry_details(p_enqu_id);
al('Enquiry type: ' || get_enty_description(p_enqu_id)); produce_quote_summary(l_qute_id);
produce_enquiry_entry_details(p_enqu_id); al(' ');
al('Regards');
produce_reasoning_summary(p_enqu_id); al(' ');
al('I&C Online Quotations System');
ELSIF p_email_reason = gc_internal_rmq_notification THEN
l_email_subject := get_system_name ||
': Request For Manual Quotation Notification';
al('Hi team,');
al(' ');
al('Enquiry reference number: ' || p_enqu_id);
al(' ');
al('Please provide a manual quotation as the I&C Online Quotation System was unable to generate an automatic quote.');
al(' ');
SELECT qute_id
INTO l_qute_id
FROM quote_events quev
,quotes qute
WHERE qute.enqu_id = p_enqu_id
AND quev.qute_id = qute.id
AND quev.qust_code = 'INP';
produce_enquiry_entry_details(p_enqu_id);
produce_reasoning_summary(p_enqu_id);
al(' ');
al('Regards');
al(' ');
al('I&C Online Quotations System');
END IF;
close_body; close_body;
BEGIN BEGIN
mip_email.send_email_clob(p_recipient => get_manual_quote_recipient mip_email.send_email_clob(p_recipient => l_email_recipient
,p_body => g_email_plain_body ,p_body => g_email_plain_body
,p_body_html => g_email_html_body ,p_body_html => g_email_html_body
,p_subject => l_system_name || ,p_subject => l_email_subject);
': Request for a Manual Quote for Enquiry Reference Number: ' ||
p_enqu_id);
EXCEPTION EXCEPTION
WHEN OTHERS THEN WHEN OTHERS THEN
pl('mip_email.send_email_clob returned ' || SQLERRM); pl('mip_email.send_email_clob returned ' || SQLERRM);
END; END;
pl('email_internal_users:exit');
END email_to_internal_users;
PROCEDURE email_agent_aq_available(p_enqu_id IN enquiries.id%TYPE) IS
BEGIN
pl('email_agent_aq_available:entry');
END email_request_for_mq; email_to_agent(p_enqu_id => p_enqu_id
,p_email_reason => gc_agent_qa_notification);
pl('email_agent_aq_available:exit');
END email_agent_aq_available;
PROCEDURE email_agent_mq_available(p_enqu_id enquiries.id%TYPE) IS
BEGIN
email_to_agent(p_enqu_id => p_enqu_id
,p_email_reason => gc_agent_mqa_notification);
END email_agent_mq_available;
PROCEDURE email_agent_request_for_mq(p_enqu_id IN enquiries.id%TYPE) IS
l_system_name system_configuration.VALUE%TYPE := get_system_name;
l_quote_row quotes%ROWTYPE;
BEGIN
pl('email_request_for_mq:enter');
email_to_agent(p_enqu_id => p_enqu_id
,p_email_reason => gc_agent_rmq_notification);
email_to_internal_users(p_enqu_id => p_enqu_id
,p_email_reason => gc_internal_rmq_notification);
pl('email_request_for_mq:exit');
END email_agent_request_for_mq;
PROCEDURE email_agent_quote_acceptance(p_enqu_id IN enquiries.id%TYPE) IS
BEGIN
email_to_agent(p_enqu_id => p_enqu_id
,p_email_reason => gc_agent_qa_notification);
END email_agent_quote_acceptance;
PROCEDURE email_iu_quote_acceptance(p_enqu_id enquiries.id%TYPE) IS
BEGIN
email_to_internal_users(p_enqu_id
,gc_internal_qa_notification);
END email_iu_quote_acceptance;
PROCEDURE email_iu_request_for_mq(p_enqu_id enquiries.id%TYPE) IS
BEGIN
email_to_internal_users(p_enqu_id
,gc_internal_rmq_notification);
END email_iu_request_for_mq;
PROCEDURE email_support(p_subject IN VARCHAR2 PROCEDURE email_support(p_subject IN VARCHAR2
,p_enqu_id IN enquiries.id%TYPE) IS ,p_enqu_id IN enquiries.id%TYPE) IS
@@ -1050,8 +1094,8 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,p_rfq_prty_id => p_rfq_prty_id ,p_rfq_prty_id => p_rfq_prty_id
,p_owner_prty_id => p_owner_prty_id); ,p_owner_prty_id => p_owner_prty_id);
email_request_for_mq(p_enqu_id => p_enqu_id); email_agent_request_for_mq(p_enqu_id => p_enqu_id);
email_iu_request_for_mq(p_enqu_id => p_enqu_id);
END request_manual_quote; END request_manual_quote;
PROCEDURE ready_for_quote(p_enqu_id IN enquiries.id%TYPE PROCEDURE ready_for_quote(p_enqu_id IN enquiries.id%TYPE
@@ -1225,7 +1269,6 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
PROCEDURE survey_required(p_enqu IN t_enqu PROCEDURE survey_required(p_enqu IN t_enqu
,p_manual_or_automatic_quote IN OUT t_manual_or_automatic_quote) IS ,p_manual_or_automatic_quote IN OUT t_manual_or_automatic_quote) IS
l_svcpt_code service_pressure_types.code%TYPE;
l_existing_meter_size_code meter_size_codes.code%TYPE; l_existing_meter_size_code meter_size_codes.code%TYPE;
l_required_meter_size_code meter_size_codes.code%TYPE; l_required_meter_size_code meter_size_codes.code%TYPE;
BEGIN BEGIN
@@ -1578,8 +1621,15 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,l_rec_costs.svcpt_code ,l_rec_costs.svcpt_code
FROM (SELECT decode(regi_code FROM (SELECT decode(regi_code
,p_regi_code ,p_regi_code
,0
,1) * 100 + decode(cost.svcpt_code
,NULL
,1
,0) * 10 +
decode(cost.mesc_code
,NULL
,1 ,1
,999) AS accuracy ,0) AS accuracy
,enty_code ,enty_code
,mety_code ,mety_code
,cost.svcpt_code ,cost.svcpt_code
@@ -1593,13 +1643,11 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,service_pressures svcp ,service_pressures svcp
WHERE SYSDATE BETWEEN cost.effective_from AND cost.effective_to WHERE SYSDATE BETWEEN cost.effective_from AND cost.effective_to
AND (regi_code = p_regi_code OR regi_code IS NULL) AND (regi_code = p_regi_code OR regi_code IS NULL)
AND cost.svcpt_code = svcp.svcpt_code AND cost.svcpt_code(+) = svcp.svcpt_code
AND enty_code = p_enty_code AND enty_code = p_enty_code
AND mety_code = p_mety_code AND mety_code = p_mety_code
AND ((svcp.code = p_svcp_code) OR AND svcp.code = p_svcp_code
(svcp.code IS NULL AND p_svcp_code IS NULL)) AND ((cost.mesc_code = p_mesc_code) OR (mesc_code IS NULL))
AND ((mesc_code = p_mesc_code) OR
(mesc_code IS NULL AND p_mesc_code IS NULL))
ORDER BY 1) ORDER BY 1)
WHERE rownum < 2; WHERE rownum < 2;
@@ -2802,7 +2850,7 @@ RECEIVED AT THIS ADDRESS CANNOT BE RESPONDED TO.');
,p_manual_or_automatic_quote => l_manual_or_automatic_quote); ,p_manual_or_automatic_quote => l_manual_or_automatic_quote);
IF l_manual_or_automatic_quote = gc_automatic_quote THEN IF l_manual_or_automatic_quote = gc_automatic_quote THEN
mark_enquiry_quoted(p_enqu_id); mark_enquiry_quoted(p_enqu_id);
email_quotes_available(p_enqu_id); email_agent_aq_available(p_enqu_id);
ELSE ELSE
request_manual_quote(p_enqu_id => l_enqu.id request_manual_quote(p_enqu_id => l_enqu.id
,p_rfq_prty_id => p_rfq_prty_id ,p_rfq_prty_id => p_rfq_prty_id

View File

@@ -1,6 +1,6 @@
-- C:\Andy\svn\WEBMIP\Schema\mip.con -- C:\Andy\svn\WEBMIP\Schema\mip.con
-- --
-- Generated for Oracle 10g on Thu Feb 21 11:43:47 2008 by Server Generator 10.1.2.6.18 -- Generated for Oracle 10g on Tue Feb 26 13:19:31 2008 by Server Generator 10.1.2.6.18
PROMPT Creating Primary Key on 'SYSTEM_CONFIGURATION' PROMPT Creating Primary Key on 'SYSTEM_CONFIGURATION'
ALTER TABLE SYSTEM_CONFIGURATION ALTER TABLE SYSTEM_CONFIGURATION
@@ -501,28 +501,28 @@ ALTER TABLE REGI_ENQU_EXCLUSIONS
PROMPT Creating Check Constraint on 'METER_SIZE_CODES' PROMPT Creating Check Constraint on 'METER_SIZE_CODES'
ALTER TABLE METER_SIZE_CODES ALTER TABLE METER_SIZE_CODES
ADD (CONSTRAINT AVCON_1203594226_VALID_000 CHECK (VALID_FOR_EXISTING_METER IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_VALID_000 CHECK (VALID_FOR_EXISTING_METER IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'METER_SIZE_CODES' PROMPT Creating Check Constraint on 'METER_SIZE_CODES'
ALTER TABLE METER_SIZE_CODES ALTER TABLE METER_SIZE_CODES
ADD (CONSTRAINT AVCON_1203594226_VALID_001 CHECK (VALID_FOR_NEW_METER IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_VALID_001 CHECK (VALID_FOR_NEW_METER IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'COSTS' PROMPT Creating Check Constraint on 'COSTS'
ALTER TABLE COSTS ALTER TABLE COSTS
ADD (CONSTRAINT AVCON_1203594226_COST__000 CHECK (COST_TYPE ADD (CONSTRAINT AVCON_1204031970_COST__000 CHECK (COST_TYPE
IN ('LACO', 'BACO', 'MOCO', 'MECO', 'AICO', 'HOCO', 'COST'))) IN ('LACO', 'BACO', 'MOCO', 'MECO', 'AICO', 'HOCO', 'COST')))
/ /
PROMPT Creating Check Constraint on 'DOCUMENTS' PROMPT Creating Check Constraint on 'DOCUMENTS'
ALTER TABLE DOCUMENTS ALTER TABLE DOCUMENTS
ADD (CONSTRAINT AVCON_1203594226_DOCU__000 CHECK (DOCU_TYPE IN ('DOCU', 'INDO', 'EXDO', 'FIDO'))) ADD (CONSTRAINT AVCON_1204031970_DOCU__000 CHECK (DOCU_TYPE IN ('DOCU', 'INDO', 'EXDO', 'FIDO')))
/ /
PROMPT Creating Check Constraint on 'QUOTES' PROMPT Creating Check Constraint on 'QUOTES'
ALTER TABLE QUOTES ALTER TABLE QUOTES
ADD (CONSTRAINT AVCON_1203594226_QUTE__000 CHECK (QUTE_TYPE IN ('AQ', 'MQ', 'QUTE'))) ADD (CONSTRAINT AVCON_1204031970_QUTE__000 CHECK (QUTE_TYPE IN ('AQ', 'MQ', 'QUTE')))
/ /
PROMPT Creating Check Constraint on 'PARTY_RELATIONSHIPS' PROMPT Creating Check Constraint on 'PARTY_RELATIONSHIPS'
@@ -534,17 +534,17 @@ to_parl_rt_code = to_prtp_rt_code))
PROMPT Creating Check Constraint on 'PARTIES' PROMPT Creating Check Constraint on 'PARTIES'
ALTER TABLE PARTIES ALTER TABLE PARTIES
ADD (CONSTRAINT AVCON_1203594226_TRIPA_000 CHECK (TRIPARTITE_MEMBER IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_TRIPA_000 CHECK (TRIPARTITE_MEMBER IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'PARTIES' PROMPT Creating Check Constraint on 'PARTIES'
ALTER TABLE PARTIES ALTER TABLE PARTIES
ADD (CONSTRAINT AVCON_1203594226_STATU_000 CHECK (STATUS IN ('OPEN', 'EXPIRED', 'LOCKED'))) ADD (CONSTRAINT AVCON_1204031970_STATU_000 CHECK (STATUS IN ('OPEN', 'EXPIRED', 'LOCKED')))
/ /
PROMPT Creating Check Constraint on 'PARTIES' PROMPT Creating Check Constraint on 'PARTIES'
ALTER TABLE PARTIES ALTER TABLE PARTIES
ADD (CONSTRAINT AVCON_1203594226_PRTY__000 CHECK (PRTY_TYPE ADD (CONSTRAINT AVCON_1204031970_PRTY__000 CHECK (PRTY_TYPE
IN ('PRTY', 'IO', 'EO', 'MKTP', 'PERS', 'MANU', 'NEMP', 'EMP', 'ORG' IN ('PRTY', 'IO', 'EO', 'MKTP', 'PERS', 'MANU', 'NEMP', 'EMP', 'ORG'
))) )))
/ /
@@ -562,82 +562,82 @@ OR
PROMPT Creating Check Constraint on 'DOCUMENT_ROLES' PROMPT Creating Check Constraint on 'DOCUMENT_ROLES'
ALTER TABLE DOCUMENT_ROLES ALTER TABLE DOCUMENT_ROLES
ADD (CONSTRAINT AVCON_1203594226_DORO__000 CHECK (DORO_TYPE IN ('DRRO', 'DORO', 'ENDO', 'QUDO'))) ADD (CONSTRAINT AVCON_1204031970_DORO__000 CHECK (DORO_TYPE IN ('DRRO', 'DORO', 'ENDO', 'QUDO')))
/ /
PROMPT Creating Check Constraint on 'QUOTE_ITEMS' PROMPT Creating Check Constraint on 'QUOTE_ITEMS'
ALTER TABLE QUOTE_ITEMS ALTER TABLE QUOTE_ITEMS
ADD (CONSTRAINT AVCON_1203594226_QUIT__000 CHECK (QUIT_TYPE IN ('LQI', 'AQI', 'BQI', 'MQI', 'QUIT', 'HQI'))) ADD (CONSTRAINT AVCON_1204031970_QUIT__000 CHECK (QUIT_TYPE IN ('LQI', 'AQI', 'BQI', 'MQI', 'QUIT', 'HQI')))
/ /
PROMPT Creating Check Constraint on 'ROLE_TYPES' PROMPT Creating Check Constraint on 'ROLE_TYPES'
ALTER TABLE ROLE_TYPES ALTER TABLE ROLE_TYPES
ADD (CONSTRAINT AVCON_1203594226_RT_TY_000 CHECK (RT_TYPE IN ('DORT', 'PART', 'RT', 'PCMRT', 'QURT', 'ENRT', 'PRT'))) ADD (CONSTRAINT AVCON_1204031970_RT_TY_000 CHECK (RT_TYPE IN ('DORT', 'PART', 'RT', 'PCMRT', 'QURT', 'ENRT', 'PRT')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_DOWNS_000 CHECK (DOWNSTREAM_BOOSTER_OR_COMPRESS IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_DOWNS_000 CHECK (DOWNSTREAM_BOOSTER_OR_COMPRESS IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_INDIC_000 CHECK (INDICATIVE_TIME IN ('DY', 'AM', 'PM'))) ADD (CONSTRAINT AVCON_1204031970_INDIC_000 CHECK (INDICATIVE_TIME IN ('DY', 'AM', 'PM')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_HOUSI_000 CHECK (HOUSING_REQUIRED IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_HOUSI_000 CHECK (HOUSING_REQUIRED IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_BASE__000 CHECK (BASE_REQUIRED IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_BASE__000 CHECK (BASE_REQUIRED IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_CONVE_000 CHECK (CONVERTOR_REQUIRED IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_CONVE_000 CHECK (CONVERTOR_REQUIRED IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_AMR_R_000 CHECK (AMR_REQUIRED IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_AMR_R_000 CHECK (AMR_REQUIRED IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_EMS_R_000 CHECK (EMS_REQUIRED IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_EMS_R_000 CHECK (EMS_REQUIRED IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_TWIN__000 CHECK (TWIN_STREAM_REQUIRED IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_TWIN__000 CHECK (TWIN_STREAM_REQUIRED IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_EXIST_000 CHECK (EXISTING_LOGGER IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_EXIST_000 CHECK (EXISTING_LOGGER IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_LOAD__000 CHECK (LOAD_CONTROL_TYPE IN ('Constant', 'On/Off', 'Modulating'))) ADD (CONSTRAINT AVCON_1204031970_LOAD__000 CHECK (LOAD_CONTROL_TYPE IN ('Constant', 'On/Off', 'Modulating')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_EXIST_001 CHECK (EXISTING_METER_OWNER IN ('S', 'T', 'C'))) ADD (CONSTRAINT AVCON_1204031970_EXIST_001 CHECK (EXISTING_METER_OWNER IN ('S', 'T', 'C')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_EXIST_002 CHECK (EXISTING_CONVERTOR IN ('YES', 'NO'))) ADD (CONSTRAINT AVCON_1204031970_EXIST_002 CHECK (EXISTING_CONVERTOR IN ('YES', 'NO')))
/ /
PROMPT Creating Check Constraint on 'ENQUIRIES' PROMPT Creating Check Constraint on 'ENQUIRIES'
ALTER TABLE ENQUIRIES ALTER TABLE ENQUIRIES
ADD (CONSTRAINT AVCON_1203594226_MARKE_000 CHECK (MARKET_SECTOR_CODE IN ('I', 'D'))) ADD (CONSTRAINT AVCON_1204031970_MARKE_000 CHECK (MARKET_SECTOR_CODE IN ('I', 'D')))
/ /
PROMPT Creating Check Constraint on 'REGI_ENQU_EXCLUSIONS' PROMPT Creating Check Constraint on 'REGI_ENQU_EXCLUSIONS'

View File

@@ -1,6 +1,6 @@
-- C:\Andy\svn\WEBMIP\Schema\mip.ind -- C:\Andy\svn\WEBMIP\Schema\mip.ind
-- --
-- Generated for Oracle 10g on Thu Feb 21 11:43:47 2008 by Server Generator 10.1.2.6.18 -- Generated for Oracle 10g on Tue Feb 26 13:19:31 2008 by Server Generator 10.1.2.6.18
PROMPT Creating Index 'REGU_RETY_FK_I' PROMPT Creating Index 'REGU_RETY_FK_I'

View File

@@ -1,6 +1,6 @@
-- C:\Andy\svn\WEBMIP\Schema\mip.sql -- C:\Andy\svn\WEBMIP\Schema\mip.sql
-- --
-- Generated for Oracle 10g on Thu Feb 21 11:43:47 2008 by Server Generator 10.1.2.6.18 -- Generated for Oracle 10g on Tue Feb 26 13:19:31 2008 by Server Generator 10.1.2.6.18
SPOOL mip.lst SPOOL mip.lst

View File

@@ -1,6 +1,6 @@
-- C:\Andy\svn\WEBMIP\Schema\mip.sqs -- C:\Andy\svn\WEBMIP\Schema\mip.sqs
-- --
-- Generated for Oracle 10g on Thu Feb 21 11:43:47 2008 by Server Generator 10.1.2.6.18 -- Generated for Oracle 10g on Tue Feb 26 13:19:31 2008 by Server Generator 10.1.2.6.18
PROMPT Creating Sequence 'FLTR_SEQ' PROMPT Creating Sequence 'FLTR_SEQ'
CREATE SEQUENCE FLTR_SEQ CREATE SEQUENCE FLTR_SEQ

View File

@@ -1,6 +1,6 @@
-- C:\Andy\svn\WEBMIP\Schema\mip.tab -- C:\Andy\svn\WEBMIP\Schema\mip.tab
-- --
-- Generated for Oracle 10g on Thu Feb 21 11:43:46 2008 by Server Generator 10.1.2.6.18 -- Generated for Oracle 10g on Tue Feb 26 13:19:30 2008 by Server Generator 10.1.2.6.18
@@ -444,16 +444,16 @@ CREATE TABLE METERS
(CODE VARCHAR2(80) NOT NULL (CODE VARCHAR2(80) NOT NULL
,METY_CODE VARCHAR2(80) NOT NULL ,METY_CODE VARCHAR2(80) NOT NULL
,PRTY_ID NUMBER NOT NULL ,PRTY_ID NUMBER NOT NULL
,DIM_A NUMBER NOT NULL
,DIM_B NUMBER NOT NULL
,DIM_C NUMBER NOT NULL
,CENTRES NUMBER NOT NULL
,WEIGHT NUMBER NOT NULL
,QMAX NUMBER NOT NULL ,QMAX NUMBER NOT NULL
,DRWG_CODE VARCHAR2(80)
,DIM_A NUMBER
,DIM_B NUMBER
,DIM_C NUMBER
,CENTRES NUMBER
,WEIGHT NUMBER
,QMIN NUMBER NOT NULL ,QMIN NUMBER NOT NULL
,QNOM NUMBER NOT NULL ,QNOM NUMBER NOT NULL
,VALID_FROM DATE NOT NULL ,VALID_FROM DATE NOT NULL
,DRWG_CODE VARCHAR2(80)
,VALID_TO DATE ,VALID_TO DATE
) )
/ /