You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if JSQLParser could also parse TOP expressions.
Currently only two variants are supported as a TOP clause and these will parse successfully:
Constant value, example: SELECT TOP (2) * FROM MyTable
JDBC parameter, example: SELECT TOP (?) * FROM MyTable
More complex expressions are currently not supported and give a ParseException. Example queries that fail to be parsed:
SELECT TOP (? + 1) * FROM MyTable
SELECT TOP (CAST(? AS INT)) * FROM MyTable
I feel like it could be relatively simple to implement this, by letting net.sf.jsqlparser.statement.select.Top have a method getRowCountExpression which returns a scalar expression as a net.sf.jsqlparser.expression.Expression object.
On a side note: the JSQLParser library is greatly appreciated by us. Thanks to the authors!
The text was updated successfully, but these errors were encountered:
It would be great if JSQLParser could also parse TOP expressions.
Currently only two variants are supported as a TOP clause and these will parse successfully:
SELECT TOP (2) * FROM MyTable
SELECT TOP (?) * FROM MyTable
More complex expressions are currently not supported and give a
ParseException
. Example queries that fail to be parsed:SELECT TOP (? + 1) * FROM MyTable
SELECT TOP (CAST(? AS INT)) * FROM MyTable
I feel like it could be relatively simple to implement this, by letting
net.sf.jsqlparser.statement.select.Top
have a methodgetRowCountExpression
which returns a scalar expression as anet.sf.jsqlparser.expression.Expression
object.On a side note: the JSQLParser library is greatly appreciated by us. Thanks to the authors!
The text was updated successfully, but these errors were encountered: