Public.getmanagedservicecountforintf (function)

From dbscript Online Help
Revision as of 08:31, 11 February 2010 by Bot (talk | contribs)
Jump to: navigation, search

wikibot

CREATE OR REPLACE FUNCTION public.getmanagedservicecountforintf(integer, character varying)

RETURNS double precision
LANGUAGE plpgsql

AS $function$

  DECLARE

nid ALIAS FOR $1; ipid ALIAS FOR $2; orec RECORD; counter float8;

  BEGIN

counter = 0; FOR orec IN SELECT DISTINCT ifservices.nodeid, ifservices.ipaddr, ifservices.serviceid FROM ipinterface, ifservices WHERE ifservices.nodeid = nid AND ifservices.ipaddr = ipid AND ipinterface.nodeid = nid AND ipinterface.ipaddr = ipid AND ipinterface.ismanaged = 'M' AND ifservices.status = 'A' LOOP BEGIN counter := counter + 1; END; END LOOP; RETURN counter;

  END;

$function$ |- | Select | Table | public.ifservices

|- | Select | Table | public.ipinterface

|- | Execute | Function | public.getmanagepercentavailintfwindow