DEFINITIONS

Definitions More Info.
Definition ID2.015
TitlePOSTGRESQL
CategoryNOTES
Definitionparametreli WHILE loop example kariyer function fonksiyon
Definition DescriptionCREATE 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;
RecordBycunay
Record Date10-04-2020 17:41:19
Düzenle
Kopyala
Sil