Difference between revisions of "Public.getmanagedservicecountfornode (function)"

From dbscript Online Help
Jump to: navigation, search
Line 1: Line 1:
 
== wikibot ==
 
== wikibot ==
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|-
 +
| '''Function
 +
| public.getmanagedservicecountfornode
 +
|-
 +
|}
 +
 +
 +
=== Source ===
 +
<pre>
 
CREATE OR REPLACE FUNCTION public.getmanagedservicecountfornode(integer)
 
CREATE OR REPLACE FUNCTION public.getmanagedservicecountfornode(integer)
 
  RETURNS double precision
 
  RETURNS double precision
Line 25: Line 36:
 
   END;
 
   END;
 
$function$
 
$function$
 +
</pre>
 +
 +
=== References ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 +
| '''Referenced Object
 +
 
|-
 
|-
 
| Select
 
| Select
Line 34: Line 54:
 
| Table
 
| Table
 
| [[public.ipinterface_(table)|public.ipinterface]]
 
| [[public.ipinterface_(table)|public.ipinterface]]
 +
 +
|}
 +
 +
=== Dependencies ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 +
| '''Referencing Object
  
 
|-
 
|-
Line 39: Line 68:
 
| Function
 
| Function
 
| [[public.getmanagepercentavailnodewindow_(function)|public.getmanagepercentavailnodewindow]]
 
| [[public.getmanagepercentavailnodewindow_(function)|public.getmanagepercentavailnodewindow]]
 +
 +
|}

Revision as of 08:37, 11 February 2010

wikibot

Function public.getmanagedservicecountfornode


Source

CREATE OR REPLACE FUNCTION public.getmanagedservicecountfornode(integer)
 RETURNS double precision
 LANGUAGE plpgsql
AS $function$
   DECLARE
        nid ALIAS FOR $1;
        orec RECORD;
        counter float8;
   BEGIN
        counter = 0;
         FOR orec IN SELECT distinct ifservices.nodeid, ifservices.serviceid, ifservices.ipaddr
                FROM ipinterface, ifservices
                WHERE ifservices.nodeid = nid
                        AND ipinterface.nodeid = nid
                        AND ipinterface.ismanaged = 'M'
                        AND ifservices.ipaddr = ipinterface.ipaddr
                        AND ifservices.status = 'A'
        LOOP
                BEGIN
                         counter := counter + 1;
                END;
        END LOOP;
        RETURN counter;
   END;
$function$

References

Dependency Type Object Type Referenced Object
Select Table public.ifservices
Select Table public.ipinterface

Dependencies

Reference Type Object Type Referencing Object
Execute Function public.getmanagepercentavailnodewindow