-- B1 DEPENDS: AFTER:SP:BEM_CLEAR_OLD_DATA AFTER:PT:PROCESS_END

CREATE PROCEDURE BEM_CLEAR_TRANS_REP (
	-- input parameters
	REP_ID NVARCHAR (36)	-- replication id from bem, all data in BEM2 with this rep will be removed.
)
LANGUAGE SQLSCRIPT 
SQL SECURITY INVOKER

AS
BEGIN

CALL BEM_CLEAR_OLD_DATA();
DELETE FROM BEM2 WHERE "RepId" = :REP_ID;

END;