This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Automated process to truncate a table

 
Praveen RajKumar
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We have a table where we keep track of recent transactions.
Whenever the no.of records count reaches 10000 we truncate the table.

Till now we are doing this process manually.
Is there any automated process to write a procedure and schedule it to complete this activity.

thanks
Praveen
 
Ashwin Sridhar
Ranch Hand
Posts: 272
Flex Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you could do it. You could create a schedule job for your stored procedure. Refer this .

You could also have this done other way round. A Java processor calling your stored procedure and a Shell Script calling your Java Processor and you create a schedule job for this script file.

The first approach would be easier to implement.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47232
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume by truncate you mean decapitate, otherwise you would lose the newer records.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic