Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Velocity: '<limitClause>'

    Hello, using SGWT 3.0 Power, with a MySQL database.

    For a particular operationBinding I want to do the limit part in the FROM clause, like so:
    Code:
    <tableClause>
    (SELECT Shop_id from Shop LIMIT $dsRequest.getStartRow(), $dsRequest.getEndRow()) q  LEFT OUTER JOIN Item ON 	q.Shop_id=Item.Shop_id
    </tableClause>
    But now, the generated query will still ALSO have the LIMIT 2,1 on the normal WHERE position:
    Code:
          WHERE ('1'='1') LIMIT 0, 1
    Is there a way to override this (getting rid of the LIMIT in the where clause), while maintaining the rest of the $defaultWhereClause?

    I was thinking about a <limitClause></limitClause> where this overrules any limit, but according to the Quick Start Guide there is no such thing as a <limitClause>

    Is there a way of doing this?
    Last edited by Sytematic; 11 Jan 2012, 05:03.

    #2
    This is a case where you just want to use <customSQL>. With <customSQL>, $defaultWhereClause et al are available to you, so you can reuse whatever parts of the generated query still apply.

    Comment


      #3
      Great, that indeed worked well!

      Comment

      Working...
      X