Hi Krishna,
You can write a stored proc, where, in the main cursor, select column having
unique value for the records to be deleted,
For example

select item_id from table_name where <date_column>   <   sysdate - 180.

This cursor will give you value of a column older than 180 days,

and inside the main stored proc, you can use a delete statment, to delete
each item_id.

delete from <table_name> where item_id=<variable_name>;

commit for every 1000 or 10000 records, so that there is no rollback issue.

Also if data is very less than you can directly use the delete statment
rather than doing this in stored proc.

regards
anandkl


On 7/5/07, krishna chandra prajapati <[EMAIL PROTECTED]> wrote:

Hi All,

I am just trying to delete one year data from many databases and the no.
of
tables is more than 200. I want to keep only six months data on the mysql
server. Is there is any way to do this.
Please help me.

Regards,
Krishna

Reply via email to