Difference between revisions of "Public.getmanagedservicecountfornode (function)"
Line 35: | Line 35: | ||
$function$ | $function$ | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 10:19, 27 August 2011
wikibot[edit]
Function | public.getmanagedservicecountfornode |
Source[edit]
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$