| Author |
Java DB - Delete all records in a table.
|
ash neet
Ranch Hand
Joined: Dec 21, 2010
Posts: 33
|
|
Hey,
Can anyone please tell me how do i delete all the records in a table with a single query?
I am using Squirrel SQL client for databases.
I tried using -> truncate table table_name;
but it is'nt working.
Thanks in advance!
|
 |
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1237
|
|
|
How about using delete from tablename?
|
Swastik
|
 |
ash neet
Ranch Hand
Joined: Dec 21, 2010
Posts: 33
|
|
Swastik Dey wrote:How about using delete from tablename?
Hey Thanks Swastik, it worked!
but i want to restore the auto-increment primary key after deleting all records, that's why i was using truncate. how do we do this in java DB?
|
 |
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1237
|
|
|
Whats going wrong with truncate?
|
 |
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2350
|
|
ash neet wrote:...I tried using -> truncate table table_name;
but it is'nt working.
...
What happens?
|
OCUP UML fundamental
ITIL foundation
|
 |
ash neet
Ranch Hand
Joined: Dec 21, 2010
Posts: 33
|
|
Jan Cumps wrote:
ash neet wrote:...I tried using -> truncate table table_name;
but it is'nt working.
...
What happens?
it gives me the following error when i use the syntax - "truncate table table_name"
Error: Feature not implemented: truncate table.
|
 |
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1237
|
|
This seems to be a bug in java db
http://www.talendforge.org/forum/viewtopic.php?id=784
|
 |
ash neet
Ranch Hand
Joined: Dec 21, 2010
Posts: 33
|
|
Thanks! i will upgrade my java db.
|
 |
 |
|
|
subject: Java DB - Delete all records in a table.
|
|
|