Please critique my stored proc
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;
/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get Instant Hacker Protection, Virus Detection, Antispam & Personal Firewall.
http://www.houseoffusion.com/banners/view.cfm?bannerid=62
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1051
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54