src-db/database/model/functions/AD_MESSAGE_GET2.xml
changeset 756 ae11e4610537
parent 735 daced7e311c9
child 799 fef2c5e2feb7
equal deleted inserted replaced
755:16b55e593268 756:ae11e4610537
       
     1 <?xml version="1.0"?>
       
     2   <database name="FUNCTION AD_MESSAGE_GET2">
       
     3     <function name="AD_MESSAGE_GET2" type="NVARCHAR">
       
     4       <parameter name="p_value" type="NVARCHAR" mode="in">
       
     5         <default/>
       
     6       </parameter>
       
     7       <parameter name="p_ad_language" type="VARCHAR" mode="in">
       
     8         <default/>
       
     9       </parameter>
       
    10       <body><![CDATA[/******************************************************************************
       
    11 * The contents of this file are subject to the   Compiere License  Version 1.1
       
    12 * ("License"); You may not use this file except in compliance with the License
       
    13 * You may obtain a copy of the License at http://www.compiere.org/license.html
       
    14 * Software distributed under the License is distributed on an  "AS IS"  basis,
       
    15 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
       
    16 * the specific language governing rights and limitations under the License.
       
    17 * The Original Code is                  Compiere  ERP &  Business Solution
       
    18 * The Initial Developer of the Original Code is Jorg Janke  and ComPiere, Inc.
       
    19 * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
       
    20 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
       
    21 * Contributor(s): Openbravo SL
       
    22 * Contributions are Copyright (C) 2001-2006 Openbravo S.L.
       
    23 ******************************************************************************/
       
    24   v_RetValue AD_Message.MsgText%TYPE;
       
    25 BEGIN
       
    26 BEGIN
       
    27   IF p_AD_Language = 'en_US' THEN
       
    28     SELECT AD_MESSAGE.MSGTEXT
       
    29       INTO v_RetValue
       
    30       FROM AD_MESSAGE
       
    31      WHERE AD_MESSAGE.VALUE = p_Value;
       
    32   ELSE
       
    33     SELECT AD_MESSAGE_TRL.MSGTEXT
       
    34       INTO v_RetValue
       
    35       FROM AD_MESSAGE, AD_MESSAGE_TRL
       
    36      WHERE AD_MESSAGE.AD_MESSAGE_ID = AD_MESSAGE_TRL.AD_MESSAGE_ID
       
    37        AND AD_MESSAGE_TRL.AD_LANGUAGE = p_AD_Language
       
    38        AND AD_MESSAGE.VALUE = p_Value;
       
    39   END IF;
       
    40 
       
    41   /*POSTGRESQL>
       
    42   IF (NOT FOUND) THEN
       
    43   RETURN <' || p_Value || '>';
       
    44   END IF;
       
    45   <POSTGRESQL*/
       
    46   /*ORACLE>*/
       
    47 
       
    48 EXCEPTION
       
    49   WHEN OTHERS THEN
       
    50     RETURN p_Value;
       
    51 END;
       
    52 --
       
    53 RETURN v_RetValue;
       
    54 END AD_MESSAGE_GET2
       
    55 ]]></body>
       
    56     </function>
       
    57   </database>