src-db/database/model/functions/AD_ISMEMBERINCLUDED.xml
changeset 1605 8a0fe0193bef
parent 756 ae11e4610537
child 6701 690d2af86089
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2   <database name="FUNCTION AD_ISMEMBERINCLUDED">
     2   <database name="FUNCTION AD_ISMEMBERINCLUDED">
     3     <function name="AD_ISMEMBERINCLUDED" type="NUMERIC">
     3     <function name="AD_ISMEMBERINCLUDED" type="NUMERIC">
     4       <parameter name="p_nodeid" type="NUMERIC" mode="in">
     4       <parameter name="p_nodeid" type="VARCHAR" mode="in">
     5         <default/>
     5         <default/>
     6       </parameter>
     6       </parameter>
     7       <parameter name="p_parentid" type="NUMERIC" mode="in">
     7       <parameter name="p_parentid" type="VARCHAR" mode="in">
     8         <default/>
     8         <default/>
     9       </parameter>
     9       </parameter>
    10       <parameter name="p_treeid" type="NUMERIC" mode="in">
    10       <parameter name="p_treeid" type="VARCHAR" mode="in">
    11         <default/>
    11         <default/>
    12       </parameter>
    12       </parameter>
    13       <body><![CDATA[/*************************************************************************
    13       <body><![CDATA[/*************************************************************************
    14 * The contents of this file are subject to the Openbravo  Public  License
    14 * The contents of this file are subject to the Openbravo  Public  License
    15 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
    15 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
    29 /*************************************************************************
    29 /*************************************************************************
    30 * Title: Return 'Tree Level' if nodeID is a leaf of the tree
    30 * Title: Return 'Tree Level' if nodeID is a leaf of the tree
    31 *    where parentID is the root. Else return -1
    31 *    where parentID is the root. Else return -1
    32 ************************************************************************/
    32 ************************************************************************/
    33   v_Level NUMBER:=0;
    33   v_Level NUMBER:=0;
    34   v_Parent NUMBER(10) ;
    34   v_Parent VARCHAR2(32) ;
    35   v_Node   NUMBER(10) ;
    35   v_Node   VARCHAR2(32) ;
    36 BEGIN
    36 BEGIN
    37   v_Parent:=p_nodeID;
    37   v_Parent:=p_nodeID;
    38   WHILE v_Parent IS NOT NULL
    38   WHILE v_Parent IS NOT NULL
    39   LOOP
    39   LOOP
    40     v_Level:=v_Level + 1;
    40     v_Level:=v_Level + 1;