From cdff5f34b6350a822f47a298bc43883059bb0952 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 18 May 2007 16:41:51 +0000 Subject: [PATCH] Duplicate sql function - see ProductAttribute.sql file --- .../oracle/functions/M_Attribute_Name.sql | 84 ------------------- 1 file changed, 84 deletions(-) delete mode 100644 db/ddlutils/oracle/functions/M_Attribute_Name.sql diff --git a/db/ddlutils/oracle/functions/M_Attribute_Name.sql b/db/ddlutils/oracle/functions/M_Attribute_Name.sql deleted file mode 100644 index 44427bbe73..0000000000 --- a/db/ddlutils/oracle/functions/M_Attribute_Name.sql +++ /dev/null @@ -1,84 +0,0 @@ -CREATE OR REPLACE FUNCTION productAttribute -( - p_M_AttributeSetInstance_ID IN NUMBER -) -RETURN VARCHAR2 -/************************************************************************* - * 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-2001 Jorg Janke, ComPiere, Inc. All Rights Reserved. - ************************************************************************* - * $Id: M_Attribute_Name.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $ - *** - * Title: Return Instance Attribute Info - * Description: - * - * Test: - SELECT M_Attribute_Name (M_AttributeSetInstance_ID) - FROM M_InOutLine WHERE M_AttributeSetInstance_ID > 0 - -- - SELECT p.Name - FROM C_InvoiceLine il LEFT OUTER JOIN M_Product p ON (il.M_Product_ID=p.M_Product_ID); - SELECT p.Name || M_Attribute_Name (il.M_AttributeSetInstance_ID) - FROM C_InvoiceLine il LEFT OUTER JOIN M_Product p ON (il.M_Product_ID=p.M_Product_ID); - - ************************************************************************/ -AS - v_Name VARCHAR2(2000) := NULL; - v_NameAdd VARCHAR2(2000) := ''; - -- - v_Lot M_AttributeSetInstance.Lot%TYPE; - v_LotStart M_AttributeSet.LotCharSOverwrite%TYPE; - v_LotEnd M_AttributeSet.LotCharEOverwrite%TYPE; - v_SerNo M_AttributeSetInstance.SerNo%TYPE; - v_SerNoStart M_AttributeSet.SerNoCharSOverwrite%TYPE; - v_SerNoEnd M_AttributeSet.SerNoCharEOverwrite%TYPE; - v_GuaranteeDate M_AttributeSetInstance.GuaranteeDate%TYPE; - -- - CURSOR CUR_Attributes IS - SELECT ai.Value, a.Name - FROM M_AttributeInstance ai - INNER JOIN M_Attribute a ON (ai.M_Attribute_ID=a.M_Attribute_ID AND a.IsInstanceAttribute='Y') - WHERE ai.M_AttributeSetInstance_ID=p_M_AttributeSetInstance_ID; - -BEGIN -/* -- Get Product Name - SELECT Name - INTO v_Name - FROM M_Product WHERE M_Product_ID=p_M_Product_ID; -*/ - -- Get Product Attribute Set Instance - IF (p_M_AttributeSetInstance_ID > 0) THEN - SELECT asi.Lot, asi.SerNo, asi.GuaranteeDate, - COALESCE(a.SerNoCharSOverwrite, '#'), COALESCE(a.SerNoCharEOverwrite, ''), - COALESCE(a.LotCharSOverwrite, '«'), COALESCE(a.LotCharEOverwrite, '»') - INTO v_Lot, v_SerNo, v_GuaranteeDate, - v_SerNoStart, v_SerNoEnd, v_LotStart, v_LotEnd - FROM M_AttributeSetInstance asi - INNER JOIN M_AttributeSet a ON (asi.M_AttributeSet_ID=a.M_AttributeSet_ID) - WHERE asi.M_AttributeSetInstance_ID=p_M_AttributeSetInstance_ID; - -- - IF (v_SerNo IS NOT NULL) THEN - v_NameAdd := v_NameAdd || v_SerNoStart || v_SerNo || v_SerNoEnd || ' '; - END IF; - IF (v_Lot IS NOT NULL) THEN - v_NameAdd := v_NameAdd || v_LotStart || v_Lot || v_LotEnd || ' '; - END IF; - IF (v_GuaranteeDate IS NOT NULL) THEN - v_NameAdd := v_NameAdd || v_GuaranteeDate || ' '; - END IF; - -- - FOR a IN CUR_Attributes LOOP - v_NameAdd := v_NameAdd || a.Name || ':' || a.Value || ' '; - END LOOP; - -- - IF (LENGTH(v_NameAdd) > 0) THEN - v_Name := v_Name || ' (' || TRIM(v_NameAdd) || ')'; - END IF; - END IF; - - RETURN v_Name; -END productAttribute; -/ \ No newline at end of file