modules/org.openbravo.client.application/src-db/database/model/functions/OBUIAPP_LANGUAGE_CREATE.xml
author Harpreet Singh <harpreet@openbravo.com>
Fri, 10 Dec 2010 19:47:45 +0100
changeset 9076 c4f1a5c7d7c2
child 10780 bcc1e52f9ea9
permissions -rw-r--r--
Added 3.0 modules to modules dir and changed the VERSION number
harpreet@9076
     1
<?xml version="1.0"?>
harpreet@9076
     2
  <database name="FUNCTION OBUIAPP_LANGUAGE_CREATE">
harpreet@9076
     3
    <function name="OBUIAPP_LANGUAGE_CREATE" type="NULL">
harpreet@9076
     4
      <parameter name="ep_instance_id" type="VARCHAR" mode="in">
harpreet@9076
     5
        <default/>
harpreet@9076
     6
      </parameter>
harpreet@9076
     7
      <body><![CDATA[/*************************************************************************
harpreet@9076
     8
* The contents of this file are subject to the Openbravo  Public  License
harpreet@9076
     9
* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
harpreet@9076
    10
* Version 1.1  with a permitted attribution clause; you may not  use this
harpreet@9076
    11
* file except in compliance with the License. You  may  obtain  a copy of
harpreet@9076
    12
* the License at http://www.openbravo.com/legal/license.html
harpreet@9076
    13
* Software distributed under the License  is  distributed  on  an "AS IS"
harpreet@9076
    14
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
harpreet@9076
    15
* License for the specific  language  governing  rights  and  limitations
harpreet@9076
    16
* under the License.
harpreet@9076
    17
* The Original Code is Openbravo ERP.
harpreet@9076
    18
* The Initial Developer of the Original Code is Openbravo SLU
harpreet@9076
    19
* All portions are Copyright (C) 2010 Openbravo SLU
harpreet@9076
    20
* All Rights Reserved.
harpreet@9076
    21
* Contributor(s):  ______________________________________.
harpreet@9076
    22
************************************************************************/
harpreet@9076
    23
harpreet@9076
    24
  v_rowcount NUMBER;
harpreet@9076
    25
harpreet@9076
    26
  BEGIN
harpreet@9076
    27
    INSERT INTO OBUIAPP_Parameter_Trl  
harpreet@9076
    28
           (OBUIAPP_PARAMETER_TRL_ID, AD_CLIENT_ID, AD_ORG_ID               ,                                             
harpreet@9076
    29
            ISACTIVE                , CREATED     , CREATEDBY               ,                                             
harpreet@9076
    30
            UPDATED                 , UPDATEDBY   , OBUIAPP_PARAMETER_ID    ,                                             
harpreet@9076
    31
            NAME                    , DESCRIPTION , HELP                    ,                                             
harpreet@9076
    32
            ISTRANSLATED            , AD_LANGUAGE)
harpreet@9076
    33
     SELECT get_uuid()              , p.AD_CLIENT_ID, p.AD_ORG_ID           ,                                             
harpreet@9076
    34
            p.ISACTIVE              , now()     , '0'                       ,                                             
harpreet@9076
    35
            now()                   , '0'       , p.OBUIAPP_PARAMETER_ID    ,                                             
harpreet@9076
    36
            p.NAME                  , p.DESCRIPTION , p.HELP                ,                                             
harpreet@9076
    37
            'N'                     , l.AD_LANGUAGE
harpreet@9076
    38
       FROM OBUIAPP_Parameter p, AD_Language l, AD_Module m
harpreet@9076
    39
      WHERE l.isActive = 'Y'
harpreet@9076
    40
        AND l.IsSystemLanguage='Y'
harpreet@9076
    41
        AND m.AD_Module_ID = p.AD_Module_ID
harpreet@9076
    42
        AND M.AD_Language != l.AD_Language
harpreet@9076
    43
        AND NOT EXISTS (SELECT 1
harpreet@9076
    44
                          FROM OBUIAPP_Parameter_Trl t
harpreet@9076
    45
                         WHERE t.OBUIAPP_Parameter_ID = p.OBUIAPP_Parameter_ID
harpreet@9076
    46
                           AND t.AD_Language = l.AD_Language);
harpreet@9076
    47
harpreet@9076
    48
    v_rowcount:=SQL%ROWCOUNT;
harpreet@9076
    49
    DBMS_OUTPUT.PUT_LINE('- OBUIAPP_LANGUAGE_CREATE: OBUIAPP_Parameter_Trl ' || v_rowcount);
harpreet@9076
    50
END OBUIAPP_LANGUAGE_CREATE
harpreet@9076
    51
]]></body>
harpreet@9076
    52
    </function>
harpreet@9076
    53
  </database>