Re: Delete data from databases
Hi Krishna,
If you dont have a date column, then on what basis you would be deleting
data older than 6 months.
As i mentioned earlier, if the no. of records in the table is less then you
can use direct delete statment.
On 7/5/07, krishna chandra prajapati <prajapatikc@gmail.com> wrote:
> > Hi All, > Some of the tables have the date column. what if the table doesn't have > the > date column. The number of table in the database is more than 200. What > else > is possible. > > Is there is any other way to do this except stored procedure > > Regards, > Krishna > > On 7/5/07, Ananda Kumar <anandkl@gmail.com> wrote: > > > > 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 <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 03:30:28 2007
This archive was generated by hypermail 2.1.8
: Thu Jul 05 2007 - 03:40:02 EDT
|