src-db/database/model/functions/AD_PARENT_TREE.xml
author Juan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Wed, 03 Sep 2008 17:55:37 +0000
changeset 1605 8a0fe0193bef
parent 799 fef2c5e2feb7
child 6701 690d2af86089
permissions -rw-r--r--
Merge r2.5x intro trunk
carlos@0
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="FUNCTION AD_PARENT_TREE">
adrian@94
     3
    <function name="AD_PARENT_TREE" type="VARCHAR">
juanpablo@1605
     4
      <parameter name="p_tree_id" type="VARCHAR" mode="in">
antonio@735
     5
        <default/>
antonio@735
     6
      </parameter>
juanpablo@1605
     7
      <parameter name="p_node_id" type="VARCHAR" mode="in">
antonio@735
     8
        <default/>
antonio@735
     9
      </parameter>
asier@799
    10
      <body><![CDATA[/*************************************************************************
asier@799
    11
* The contents of this file are subject to the Openbravo  Public  License
asier@799
    12
* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
asier@799
    13
* Version 1.1  with a permitted attribution clause; you may not  use this
asier@799
    14
* file except in compliance with the License. You  may  obtain  a copy of
asier@799
    15
* the License at http://www.openbravo.com/legal/license.html
asier@799
    16
* Software distributed under the License  is  distributed  on  an "AS IS"
asier@799
    17
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
asier@799
    18
* License for the specific  language  governing  rights  and  limitations
asier@799
    19
* under the License.
asier@799
    20
* The Original Code is Openbravo ERP.
asier@799
    21
* The Initial Developer of the Original Code is Openbravo SL
asier@799
    22
* All portions are Copyright (C) 2001-2008 Openbravo SL
asier@799
    23
* All Rights Reserved.
asier@799
    24
* Contributor(s):  ______________________________________.
asier@799
    25
************************************************************************/
asier@799
    26
p VARCHAR2(32767);
juanpablo@1605
    27
  vp VARCHAR2(32);
carlos@0
    28
BEGIN
carlos@0
    29
carlos@0
    30
  SELECT parent_id
carlos@0
    31
    INTO vp
carlos@0
    32
    FROM ad_treenode
carlos@0
    33
   WHERE node_id = p_node_id
carlos@0
    34
     AND ad_tree_id = p_tree_id;
carlos@0
    35
carlos@0
    36
carlos@0
    37
    p := ad_parent_tree(p_tree_id, vp);
carlos@0
    38
    IF p != ' ' THEN
carlos@0
    39
      RETURN '|'||vp||'|'||p;
carlos@0
    40
    END IF;
carlos@0
    41
    RETURN '|'||vp||'|';
carlos@0
    42
  EXCEPTION WHEN OTHERS THEN RETURN ' ';
adrian@170
    43
END AD_PARENT_TREE
gorkaion@239
    44
]]></body>
adrian@94
    45
    </function>
adrian@94
    46
  </database>