/*****************************************************************************
*
* Filename         - $Workfile:   erase_mail.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          - 
*
* Contents         - Live Schema Stored Procedure
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   erase_mail.sql  $  $Revision:   1.4  $
*
* Revision History
*
* Note that user tagtrak is many users. For these users the user
* name is entered as the last line in the change description.
*
* $Log:   /shared/pvcs/tagtarch/db_ora/db/source/live/procedures/erase_mail.sqv  $
* 
*    Rev 1.4   02 Apr 1998 19:32:58   tagtrak
* OR:
* CR:
* REV:
* Initial Issue
* See label for concession
* 
*    Rev 1.3   15 Jan 1998 12:11:46   tagtrak
* OR: OR11101, TN13, TN15
* CR:
* REV:
* Phase 2C to Phase 3 upgrade plus code review actions and resolving some technical isses.
* 
*    Rev 1.2   24 Oct 1997 11:04:10   tagtrak
* Added PVCS header information
*
****************************************************************************/


PROMPT create or replace procedure erase_mail

create or replace procedure erase_mail is 
begin

	/*
	 * Delete mail from mail_global and mail_indiv that is 2 hours + old
	 */

	/* delete mail that is 2 hrs + old */
	delete from
		mail_global 
	where
		msg_time < sysdate - 2/24;

	delete from
		mail_indiv 
	where
		msg_time < sysdate- 2/24;
end;
/
grant execute on erase_mail to arch;
