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 Murach's Java Servlets and JSP this week in the Servlets forum!
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: http://aspose.com/file-tools
subject: how to truncate table?
Similar Threads
commit command
Java DB - Delete all records in a table.
Problem with AUTO_INCREMENT index reset when DB restarts
deleting records in smaller chunks and issuing commit?
Emptying a table but only by deleting a specified number of rows at a time