I am new at creating stored procs and did some research on google regarding the
process.
I found multiple ways of creating one and came up with a simple proc on my own
based on
my findings.
Please critique my stored proc and let me know if I should add or remove
anything
Thanks
TGirl
CREATE OR REPLACE Procedure spDeletePastOrderSavedRecords
AS
BEGIN
DELETE o.orderid, o.name, o.description
FROM orders o INNER JOIN
products p ON o.productID = p. productID
WHERE MAX(o.oder_date) <= ADD_MONTHS(CURRENT_DATE, -2)
commit;
END;
/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Stay Ahead of Hackers - Download ZoneAlarm Pro
http://www.houseoffusion.com/banners/view.cfm?bannerid=65
Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2293
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54