parametreli WHILE loop example kariyer function fonksiyon
Definition Description
CREATE OR REPLACE FUNCTION "PushNotification"."DeleteFunction"( ) RETURNS integer LANGUAGE 'plpgsql'
COST 100 VOLATILE AS $BODY$ DECLARE i INTEGER; BEGIN i := 0; WHILE( i <=3 ) loop DELETE FROM "PushNotification"."PushNotificationLog" Where "Id" in (SELECT "Id" FROM "PushNotification"."PushNotificationLog" Where "CreationDate"<=(CURRENT_TIMESTAMP - INTERVAL '45 day') Order by "Id" limit 1000000); i = i + 1; END loop; RETURN i; END; $BODY$;
ALTER FUNCTION "PushNotification"."DeleteFunction"() OWNER TO postgres;