aspose file tools*
The moose likes Beginning Java and the fly likes how to truncate table? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to truncate table?" Watch "how to truncate table?" New topic
Author

how to truncate table?

Mindy Wu
Ranch Hand

Joined: Jan 12, 2001
Posts: 121
I need to truncate the table before inserting new record into my table, can anyone tell me the syntax?
Is this right?
Statement stTruncate = con.createStatement();
stTruncate.executeUpdate("truncate table tblName");
???
Thanks!
Mindy Wu
Ranch Hand

Joined: Jan 12, 2001
Posts: 121
Never mind, i did it. The above code is right!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to truncate table?
 
Similar Threads
Emptying a table but only by deleting a specified number of rows at a time
commit command
Java DB - Delete all records in a table.
deleting records in smaller chunks and issuing commit?
Problem with AUTO_INCREMENT index reset when DB restarts