Skip to content

Commit cf42c80

Browse files
ow186003sebersole
authored andcommitted
HHH-19619: Fix support for Truncate Table in Teradata dialect (and add extra keyword found in testing)
1 parent a104469 commit cf42c80

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ protected void registerDefaultKeywords() {
112112
registerKeyword( "role" );
113113
registerKeyword( "account" );
114114
registerKeyword( "class" );
115+
registerKeyword( "title" );
115116
}
116117

117118
@Override
@@ -655,6 +656,14 @@ public boolean supportsRowValueConstructorSyntax() {
655656
return false;
656657
}
657658

659+
/**
660+
* Teradata uses the syntax DELETE FROM <tablename> ALL instead of TRUNCATE <tablename>
661+
* @param tableName the name of the table
662+
*/
663+
public String getTruncateTableStatement(String tableName) {
664+
return "delete from " + tableName + " all";
665+
}
666+
658667
@Override
659668
public boolean supportsRowValueConstructorSyntaxInInList() {
660669
return false;

0 commit comments

Comments
 (0)