src-db/database/model/functions/AD_MESSAGE_GET2.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Wed, 23 Apr 2008 17:34:12 +0000
changeset 756 ae11e4610537
parent 735 database/model/functions/AD_MESSAGE_GET2.xml@daced7e311c9
child 799 fef2c5e2feb7
permissions -rw-r--r--
Moved database folder to src-db folder
<?xml version="1.0"?>
  <database name="FUNCTION AD_MESSAGE_GET2">
    <function name="AD_MESSAGE_GET2" type="NVARCHAR">
      <parameter name="p_value" type="NVARCHAR" mode="in">
        <default/>
      </parameter>
      <parameter name="p_ad_language" type="VARCHAR" mode="in">
        <default/>
      </parameter>
      <body><![CDATA[/******************************************************************************
* The contents of this file are subject to the   Compiere License  Version 1.1
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.compiere.org/license.html
* Software distributed under the License is distributed on an  "AS IS"  basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is                  Compiere  ERP &  Business Solution
* The Initial Developer of the Original Code is Jorg Janke  and ComPiere, Inc.
* Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
* created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
* Contributor(s): Openbravo SL
* Contributions are Copyright (C) 2001-2006 Openbravo S.L.
******************************************************************************/
  v_RetValue AD_Message.MsgText%TYPE;
BEGIN
BEGIN
  IF p_AD_Language = 'en_US' THEN
    SELECT AD_MESSAGE.MSGTEXT
      INTO v_RetValue
      FROM AD_MESSAGE
     WHERE AD_MESSAGE.VALUE = p_Value;
  ELSE
    SELECT AD_MESSAGE_TRL.MSGTEXT
      INTO v_RetValue
      FROM AD_MESSAGE, AD_MESSAGE_TRL
     WHERE AD_MESSAGE.AD_MESSAGE_ID = AD_MESSAGE_TRL.AD_MESSAGE_ID
       AND AD_MESSAGE_TRL.AD_LANGUAGE = p_AD_Language
       AND AD_MESSAGE.VALUE = p_Value;
  END IF;

  /*POSTGRESQL>
  IF (NOT FOUND) THEN
  RETURN <' || p_Value || '>';
  END IF;
  <POSTGRESQL*/
  /*ORACLE>*/

EXCEPTION
  WHEN OTHERS THEN
    RETURN p_Value;
END;
--
RETURN v_RetValue;
END AD_MESSAGE_GET2
]]></body>
    </function>
  </database>