⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_resourceunavailable_trg.sql

📁 Java写的ERP系统
💻 SQL
字号:
CREATE OR REPLACE TRIGGER S_ResourceUnavailable_Trg
BEFORE INSERT OR UPDATE
	ON S_ResourceUnavailable
FOR EACH ROW
DECLARE
/*************************************************************************
 * The contents of this file are subject to the Compiere License.  You may
 * obtain a copy of the License at    http://www.compiere.org/license.html
 * Software is on an  "AS IS" basis,  WITHOUT WARRANTY OF ANY KIND, either
 * express or implied. See the License for details. Code: Compiere ERP+CRM
 * Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
 *************************************************************************
 * $Id: S_ResourceUnavailable_Trg.sql,v 1.2 2002/10/23 03:16:57 jjanke Exp $
 ***
 * Title:	Resource Unavailability
 * Description:
 *			- Truncate + Fill date
 *			- Endure that start < end
 ************************************************************************/
BEGIN
	--	Truncate + Fill Date
	:new.DateFrom := TRUNC (:new.DateFrom);
	IF (:new.DateTo IS NULL) THEN
		:new.DateTo := :new.DateFrom;
  	ELSE
		:new.DateTo := TRUNC (:new.DateTo);
   	END IF;

	--	start < end
	IF (:new.DateFrom > :new.DateTo) THEN
		RAISE_APPLICATION_ERROR(-20403, 'End Date greater than Start Date');
	END IF;

END S_ResourceUnavailable_Trg;
/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -