Hi Experts,
I want to delete the records which are less than or equal to this date MIN(TRUNC(sale_week_date)-(1/(24*60*60)))
For that I have created the following procedure.
CREATE OR REPLACE PROCEDURE DELETE_DATA_WEEK
IS
MIN_DATE DATE;
SELECT MIN(TRUNC(sale_week_date)-(1/(24*60*60))) INTO MIN_DATE FROM sales_week;
DBMS_OUTPUT.PUT_LINE(MIN_DATE);
DELETE FROM sales
WHERE sale_date <= MIN_DATE
AND sales_creation_date <= MIN_DATE
AND sales_update_date <= MIN_DATE;
END;
If declare as MIN_DATE Date; it's not taking time.
If declare as MIN_DATE Timestamp; It is taking milli seconds also. 18-OCT-13 11.59.59.000000 PM
SALE_DATE ,SALES_CREATION_DATE and SALES_UPDATE_DATE in this format 18-OCT-2013 11.59.59 AM.
Please help me.
How to delete the records which are less than or equal to this date MIN(TRUNC(sale_week_date)-(1/(24*60*60))) .
Thanks.