method
add_limit_offset!
Register or
log in
to add new notes.
benissimo -
April 14, 2011
0 thanks
Why gsub!
I notice other adapters use sql.sub!, not sql.gsub! and in fact I had trouble with adding the limit parameter to any query involving nested selects. Replacing sql.gsub! with sql.sub! solved that problem for me. Has anyone else had a similar experience with this method?
In other words, replace:
sql.gsub!(/SELECT/i, 'SELECT B.* FROM (SELECT A.*, row_number() over () AS internal$rownum FROM (SELECT')
With:
sql.sub!(/SELECT/i, 'SELECT B.* FROM (SELECT A.*, row_number() over () AS internal$rownum FROM (SELECT')


