aspose file tools*
The moose likes JDBC and the fly likes Automated process to truncate a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Automated process to truncate a table" Watch "Automated process to truncate a table" New topic
Author

Automated process to truncate a table

Praveen RajKumar
Greenhorn

Joined: Aug 23, 2012
Posts: 6
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

Joined: Jul 09, 2011
Posts: 272

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.


Ashwin Sridhar
SCJP | SCWCD | OCA
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39851
    
  28
I presume by truncate you mean decapitate, otherwise you would lose the newer records.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Automated process to truncate a table