Maxime Laval
Maxime Laval

Reputation: 4398

Truncate table with ActiveJDBC

What is the best way to truncate a table with ActiveJDBC? The Model class only has deleteAll().
So I guess I need to run a native SQL query, is Base.exec("TRUNCATE TABLE table1") the way to go?

Thanks.

Upvotes: 0

Views: 91

Answers (1)

ipolevoy
ipolevoy

Reputation: 5518

Yes, if you want to execute arbitrary SQL, use Base.exec(sql).

Upvotes: 1

Related Questions