473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Script to delete rows from a table

Hi All,

Is there a possiblity to write a script in oracle which deletes the rows from a table based on the age.i.e., I want to delete the rows which are >120 days . I have a table with millions of rows in it and I want to keep only the latest two months rows. I have the following table with column names as ERROR_IND
FEED_ID
QUEUE_ID
FEED_DT_TM

I have written "delete * from tablename where (sysdate-to_date(feed_dt_tm))>=120"

Please advise on writing a script for it.

Thanks in Advance
Jan 16 '12 #1
1 2280
rski
700 Expert 512MB
So you want ot execute that delete statement monthly? You can write simple sql script with this delete query and add a monthly crontab rule for that script if you use linux. Under windows there is also scheduler for periodic executing script but I didn't use that.
Jan 19 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rcamarda | last post by:
Hi, I need to delete rows from my user tables dependant upon there non existence from another table: delete student where student_id not in (select student_id from tblStudent) The reasons is...
11
by: suma | last post by:
Hello, I want to delete duplicate rows in a table when no primary key is defined. For eg: If we have table1 with data as below, Suma 23 100 Suma 23 100 I want to delete a row from this...
2
by: avanti | last post by:
Hi, I am trying to delete rows from a TableLayoutPanel at Runtime. I tried editing the RowStyles collection but doesn't do what I want it to. I have a table with 10 rows. I want to delete rows 2...
6
by: Ivan | last post by:
Hello to all and thanks for answer to my topics. I made one stored procedure that delete one table, but when call/execute the procedure this show SQL0532N A parent row cannot be deleted...
3
by: federicog | last post by:
I have a table with a datetime field. When I insert a row in this table, I use NOW() to insert the current time in the datetime field. Once the whole processed is finished, I update the inserted...
1
by: madhavi123 | last post by:
Hi All, I have tables in three hierarchy... I need to delete rows from the table which in 3rd level of hierarchy. For ex: Table 1 has primary key col1. Table 2 has primary key...
2
vanc
by: vanc | last post by:
I'm trying to delete a table with just around 2000 rows. What I got is timeout error. I can't use Truncate Table, which is very quick, because I have Trigger with Delete command. Is there any way to...
1
vikysaran
by: vikysaran | last post by:
Hi, i want to delete rows from two tables using one sql statement. One table is tblEmployee and other is tblUser and i want to delete all record in both of table whose UserID is EE00001
3
by: lisles | last post by:
hey,i've got a page that displays rows from a db.im want a function to dynamically delete rows.i've put it 1,bt i get an error as follows: Parse error: syntax error, unexpected T_STRING, expecting...
0
by: aswaditya | last post by:
Hi, I am new to SSIS packages. I have 6 Excel workbooks with data spread over two worksheets each and i have to map individual data to individual SQL tables. Please note that each worksheet is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.