Workarounds for Ruby on Rails + ActiveRecord + Progress OE lack of "LIMIT" syntax - Forum - OpenEdge Development - Progress Community

Workarounds for Ruby on Rails + ActiveRecord + Progress OE lack of "LIMIT" syntax

 Forum

Workarounds for Ruby on Rails + ActiveRecord + Progress OE lack of "LIMIT" syntax

  • Has anyone successfully worked around the lack of a LIMIT statement in Progress in order to connect Ruby on Rails with ActiveRecord to OE?   Very simple REST urls like http://server/agecode/1 result in symptoms like

    ActiveRecord::JDBCError: [DataDirect][OpenEdge JDBC Driver][OpenEdge] Syntax error in SQL statement at or about "LIMIT 1" (10713): SELECT  agecode.* FROM agecode  WHERE agecode.agecod = 1 LIMIT 1

    I don't want to maintain my own copy of the framework to generate custom sql .... I was hoping that someone has solved this problem, or given up because it was too hard. Any information is greatly appreciated.
  • The equivalent on LIMIT 1 is the SELECT TOP 1 in SQL.

    See  http://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dmsrf/top-clause.html

    I don't know any specifics about changing the SQL dialect for Ruby an Rails for a particular driver but it would be similar to other that use the same Syntax - eg SQL Server.  
  • Have you tried one of the ruby gems that support OpenEdge?

    rubygems.org/.../activerecord-odbc-adapter-openedge

  • There was a chap a while back who did some work with OE and Ruby - Abe Voelker. www.progresstalk.com/.../ruby-adapter-for-openedge-databases-released.121299

    https://abevoelker.com/

    Might be worth contacting him for advice? Although, beware, he's not the biggest fan of OE.

  • James, that's an awesome lead, thank you.   I'll investigate his work and reach out after I do.  

  • I punted on ODBC fairly early on and went to JDBC; I tried a bunch of things that were not successful but did not keep good notes about what failed.   The JDBC stuff looks pretty promising with a short list of stuff to deal with, but the LIMIT one seems like the hardest.  

  • If you don't want to try ODBC there are also a few JDBC versions for OpenEdge out there. Abe has one but there are several others on github and other sites.