Skip to content

Commit

Permalink
Support get next sequence value from SQL Server database
Browse files Browse the repository at this point in the history
The `ERXSQLHelper` class has a method to get the next sequence value from the database. Sequence objects were introduced in SQL Server 2012. However, the Microsoft implementation still throws an exception. This commit adds support for SQL Server sequences in the `ERXSQLHelper` class.
  • Loading branch information
hprange committed Jun 2, 2022
1 parent e16edf5 commit 4155f8d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,10 @@ public String sqlForCreateIndex(String indexName, String tableName, ColumnIndex.
return "CREATE INDEX " + indexName + " ON " + tableName + "(" + columnNames.componentsJoinedByString(",") + ")";
}

@Override
protected String sqlForGetNextValFromSequencedNamed(String sequenceName) {
return "SELECT NEXT VALUE FOR " + sequenceName;
}
}

public static class NoSQLHelper extends ERXSQLHelper {
Expand Down

0 comments on commit 4155f8d

Please sign in to comment.