Permalink
Browse files

Use DELETE instead of TRUNCATE for DB2

  • Loading branch information...
1 parent fd6c637 commit 5f3cee40971f7b42fe8cb8ecb399bdd3ebe8972f @trevorsibanda trevorsibanda committed Aug 16, 2016
Showing with 3 additions and 1 deletion.
  1. +3 −1 slick/src/main/scala/slick/jdbc/DB2Profile.scala
@@ -132,7 +132,9 @@ trait DB2Profile extends JdbcProfile {
} else super.createIndex(idx)
}
- override def truncateTable = s"TRUNCATE TABLE ${quoteTableName(tableNode)} IMMEDIATE"
+ //For compatibility with all versions of DB2
+ //http://stackoverflow.com/questions/3006999/sql-query-to-truncate-table-in-ibm-db2
+ override def truncateTable = s"DELETE FROM ${quoteTableName(tableNode)}"
}
class ColumnDDLBuilder(column: FieldSymbol) extends super.ColumnDDLBuilder(column) {

0 comments on commit 5f3cee4

Please sign in to comment.