Query with LIMIT in Postgres

822 views
Skip to first unread message

Technic

unread,
Mar 7, 2014, 9:20:59 AM3/7/14
to idem...@googlegroups.com
I have the same problem as here, i use Postgres, need operator LIMIT for pagination.
Error: org.postgresql.util.PSQLException: ERROR: syntax error at or near ""limit""

I added ( s_pg.put("\\bBMALIMIT\\b","limit") ) code line in file ConvertMap_PostgreSQL.java in method initConvertMap()
and query as simple example : "SELECT * FROM M_Product BMALIMIT 5"
is not work in iDempiere. Help solve the problem

Heng Sin Low

unread,
Mar 7, 2014, 9:42:07 AM3/7/14
to idem...@googlegroups.com
try DB_PostgreSQL.NATIVE_MARKER + "LIMIT 5 "  + DB_PostgreSQL.NATIVE_MARKER


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/75ec6671-66d8-4558-934d-ad9f3cf90133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Technic

unread,
Mar 7, 2014, 10:50:47 AM3/7/14
to idem...@googlegroups.com
Thank you very much, it works
query changed like this:

public static final String NATIVE_MARKER = "NATIVE_"+Database.DB_POSTGRESQL+"_KEYWORK";

..." + NATIVE_MARKER + "LIMIT " + countOnPage + NATIVE_MARKER + "...
Reply all
Reply to author
Forward
0 new messages