CREATE OR REPLACE FUNCTION fx_rndstr(n integer)
RETURNS character varying AS
$BODY$
DECLARE
count integer;
retValue varchar;
BEGIN
retValue := '';
FOR count IN 1..n LOOP
retValue:=retValue || chr( (floor(random()*26+65))::integer );
END LOOP;
RETURN retValue;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER
COST 100;
SQL Справочник v0.05 © 2007-2025 Igor Salnikov aka SunDoctor