Offset parameter for SQL Query

22 views
Skip to first unread message

Dmitry

unread,
Apr 23, 2014, 3:28:11 PM4/23/14
to orient-...@googlegroups.com
Is it possible to add a method setOfftet(NUMBER) or setSkip(NUMBER) to OSQLQuery  similar to the method setLimit(NUMBER)?

Thanks.

Luca Garulli

unread,
Apr 23, 2014, 3:49:58 PM4/23/14
to orient-database
Hi Dmitry,
We don't have such API but you can set the SKIP in SQL TEXT (look at SQL syntax).

Lvc@



On 23 April 2014 21:28, Dmitry <nosk...@gmail.com> wrote:
Is it possible to add a method setOfftet(NUMBER) or setSkip(NUMBER) to OSQLQuery  similar to the method setLimit(NUMBER)?

Thanks.

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dmitry

unread,
Apr 23, 2014, 4:34:40 PM4/23/14
to orient-...@googlegroups.com
I need to expose this setting dynamically.
Unfortunately, I can not pass it as a parameter and use a query such as this "select from customers limit ? offset ?".
I see such exception - com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #54: Invalid LIMIT value setted to '?' but it should be a valid integer. Example: LIMIT 10

Perhaps it makes sense to add parameterized values ​​for limit and offset?

If no secret why there is a method setLimit, but you can not make the method setOffset?

Luca Garulli

unread,
Apr 23, 2014, 4:36:45 PM4/23/14
to orient-database
Hi Dmitry,
we lately prefer to don't complicate API but rather extend the SQL. Could you create the SQL string dynamically?

Lvc@

Reply all
Reply to author
Forward
0 new messages