addLimitFor11g adds a ROWNUM-based limit for Oracle 11g and earlier versions. Uses the legacy approach with subquery and ROWNUM.
(statement string, limitCount int)
| 192 | // addLimitFor11g adds a ROWNUM-based limit for Oracle 11g and earlier versions. |
| 193 | // Uses the legacy approach with subquery and ROWNUM. |
| 194 | func addLimitFor11g(statement string, limitCount int) string { |
| 195 | if !isSelectOrWithStatement(statement) { |
| 196 | return statement |
| 197 | } |
| 198 | return fmt.Sprintf("SELECT * FROM (%s) WHERE ROWNUM <= %d", util.TrimStatement(statement), limitCount) |
| 199 | } |
| 200 | |
| 201 | // isSelectOrWithStatement checks if the statement is a SELECT or WITH statement |
| 202 | func isSelectOrWithStatement(statement string) bool { |
no test coverage detected