File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to truncate table?" Watch "how to truncate table?" New topic

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");
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:
subject: how to truncate table?
Similar Threads
Java DB - Delete all records in a table.
Emptying a table but only by deleting a specified number of rows at a time
commit command
deleting records in smaller chunks and issuing commit?
Problem with AUTO_INCREMENT index reset when DB restarts