In your script provide schema info of soa.delete_instances() is a procedure available in XXX_SOAINFRA user --> SOA package and delete_instance() is the procedure that you are calling. In my case it is PROD_SOAINFRA check in your environment and provide corresponding details. The script i provided worked on 220.127.116.11 version.
Yes it is giving count as 0 but when i do a select count(*) from composite_instance alone it give me a value of 396. I checked the table and the date is between 14th April 2013 to 15th May 2013 when difference instance got created.
It seems may be their is some issue with the data time standard which is not able to find the value accordingly.
Here's a copy of the purge script we run nightly on 11.1.16 and it seems to work for us. Hope this helps.
CREATE OR REPLACE PROCEDURE Run_Oracle_Purge_Pkg IS
-- purge all instances up to 15 days back
Max_Create_Days := 15;
Min_Create_Days := 300;
SELECT Systimestamp INTO Cur_Timestamp FROM Dual;
Min_Creation_Date := Cur_Timestamp - Min_Create_Days;
Max_Creation_Date := Cur_Timestamp - Max_Create_Days;
Max_Runtime := 120; -- minutes
Retention_Period := Max_Creation_Date;
Batch_Size := 50000;
Soa.Delete_Instances(Min_Creation_Date => Min_Creation_Date,
Max_Creation_Date => Max_Creation_Date,
Batch_Size => Batch_Size, Max_Runtime => Max_Runtime,
Retention_Period => Retention_Period,
Purge_Partitioned_Component => False