Modules/mip_helper_special_cases.pck - correction to rule OM-4
Modules/mip_quotation.pck - add prty_id and owner_prty_id to quote status procedures to record the relevant roles. Add debug routine 'pl' to write a log file of processing. Tidy-up email wording. Modules/mip_regions.pck - convert given postcode to uppercase before processing. Modules/mip_virus_check.pck - started work on the virus checking module. So far, just have the ability to write a document to the filesystem. Added new directory, 'WEBMIP_VIRUS' to store these files in. git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3381 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
77
Modules/mip_virus_check.pck
Normal file
77
Modules/mip_virus_check.pck
Normal file
@@ -0,0 +1,77 @@
|
||||
CREATE OR REPLACE PACKAGE mip_virus_check IS
|
||||
|
||||
-- Author : HARDYA
|
||||
-- Created : 23/01/2008 09:55:52
|
||||
-- Purpose : Virus checking package
|
||||
PROCEDURE write_file(p_name IN wwv_flow_files.NAME%TYPE
|
||||
,p_location IN VARCHAR2 DEFAULT 'WEBMIP_VIRUS'
|
||||
,p_fs_name IN VARCHAR2);
|
||||
END mip_virus_check;
|
||||
/
|
||||
CREATE OR REPLACE PACKAGE BODY mip_virus_check IS
|
||||
|
||||
PROCEDURE write_file(p_name IN wwv_flow_files.NAME%TYPE
|
||||
,p_location IN VARCHAR2 DEFAULT 'WEBMIP_VIRUS'
|
||||
,p_fs_name IN VARCHAR2) IS
|
||||
l_lob_loc BLOB;
|
||||
l_buffer RAW(32767);
|
||||
l_buffer_size BINARY_INTEGER;
|
||||
l_amount BINARY_INTEGER;
|
||||
l_offset NUMBER(38) := 1;
|
||||
l_chunksize INTEGER;
|
||||
l_out_file utl_file.file_type;
|
||||
|
||||
BEGIN
|
||||
|
||||
SELECT blob_content
|
||||
INTO l_lob_loc
|
||||
FROM wwv_flow_files
|
||||
WHERE NAME = p_name;
|
||||
|
||||
l_chunksize := dbms_lob.getchunksize(l_lob_loc);
|
||||
|
||||
IF (l_chunksize < 32767) THEN
|
||||
l_buffer_size := l_chunksize;
|
||||
ELSE
|
||||
l_buffer_size := 32767;
|
||||
END IF;
|
||||
|
||||
l_amount := l_buffer_size;
|
||||
|
||||
dbms_lob.OPEN(l_lob_loc
|
||||
,dbms_lob.lob_readonly);
|
||||
|
||||
l_out_file := utl_file.fopen(location => p_location
|
||||
,filename => p_fs_name
|
||||
,open_mode => 'wb'
|
||||
,max_linesize => 32767);
|
||||
|
||||
WHILE l_amount >= l_buffer_size LOOP
|
||||
|
||||
dbms_lob.READ(lob_loc => l_lob_loc
|
||||
,amount => l_amount
|
||||
,offset => l_offset
|
||||
,buffer => l_buffer);
|
||||
|
||||
l_offset := l_offset + l_amount;
|
||||
|
||||
utl_file.put_raw(file => l_out_file
|
||||
,buffer => l_buffer
|
||||
,autoflush => TRUE);
|
||||
|
||||
--utl_file.fflush(file => l_out_file);
|
||||
|
||||
END LOOP;
|
||||
|
||||
utl_file.fflush(file => l_out_file);
|
||||
|
||||
utl_file.fclose(l_out_file);
|
||||
|
||||
dbms_lob.CLOSE(l_lob_loc);
|
||||
END write_file;
|
||||
|
||||
BEGIN
|
||||
-- Initialization
|
||||
NULL;
|
||||
END mip_virus_check;
|
||||
/
|
||||
Reference in New Issue
Block a user