Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Delete data from databases

From: Ananda Kumar <anandkl(at)gmail.com>
Date: Thu Jul 05 2007 - 01:42:02 EDT


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

Do you need help?X

On 7/5/07, krishna chandra prajapati <prajapatikc@gmail.com> 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
>
Received on Thu Jul 5 01:43:36 2007

This archive was generated by hypermail 2.1.8 : Thu Jul 05 2007 - 01:50:02 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library