Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Automated process to truncate a table

 
Praveen RajKumar
Greenhorn
Posts: 6
  • 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: 277
Flex Oracle Spring
  • 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: 49789
69
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic