# Paging Through RETRIEVE Data Using ROWNUM BillingPlatform can return very large datasets when performing **RETRIEVE** operations through the web service. In some cases, the results need to be broken into smaller chunks so the client system can handle them. The **ROWNUM** operator is used as part of the ANSI SQL query passed to the RETRIEVE function to achieve this. ## Procedure ### Standalone Operation The `ROWNUM` operator can be used on its own without filters. The range defined in the `BETWEEN` expression can be adjusted (e.g., `0 AND 20`, `21 AND 40`, etc.). #### Sample SOAP Request ```xml qiAJMdPbCHOQIKumDPgiaEYADNgRsEtMltmQEUmq ROWNUM BETWEEN 0 AND 20 PRICING ``` #### Sample SOAP response ```xml 259268 2014-10-29T20:00:06.000Z USD 318 .1 259269 2014-10-29T20:00:06.000Z CAN 318 0 259270 2014-10-29T20:00:06.000Z EUR 318 0 259271 2014-10-29T20:00:06.000Z GBP 318 0 259272 2014-10-29T20:11:47.000Z USD 319 .9 259273 2014-10-29T20:11:47.000Z CAN 319 0 259274 2014-10-29T20:11:47.000Z EUR 319 0 259275 2014-10-29T20:11:47.000Z GBP 319 0 259308 2014-10-30T16:43:54.000Z 26 USD .02 259308 2014-10-30T16:43:54.000Z 34 USD .02 259308 2014-10-30T16:43:54.000Z 35 USD .02 259529 2014-11-01T02:57:24.000Z 27 USD .25 259529 2014-11-01T02:57:24.000Z 36 USD .25 261593 2014-11-07T13:38:57.000Z 28 USD 99 261704 2014-11-07T21:52:08.000Z USD 332 .5 261705 2014-11-07T21:52:08.000Z CAN 332 0 261706 2014-11-07T21:52:08.000Z EUR 332 0 261707 2014-11-07T21:52:08.000Z GBP 332 0 262151 2014-11-10T18:58:59.000Z 2909 USD .2 262268 2014-11-10T19:02:55.000Z 1155 USD .4 ``` ### Combined With Other Expressions If the query needs to be filtered but still returns a large chunk of data, the ROWNUM operator can be combined with other ANSI SQL expressions such as the example below: #### Sample SOAP Request ```xml qiAJMdPbCHOQIKumDPgiaEYADNgRsEtMltmQEUmq CurrencyCode = 'GBP' AND ROWNUM BETWEEN 0 AND 20 PRICING ``` #### Sample SOAP Response ```xml 259271 2014-10-29T20:00:06.000Z GBP 318 0 259275 2014-10-29T20:11:47.000Z GBP 319 0 261707 2014-11-07T21:52:08.000Z GBP 332 0 262777 2014-11-12T12:58:25.000Z GBP 352 0 268242 2014-11-19T15:28:39.000Z GBP 5 98380000000000000000000000002518 268243 2014-11-19T15:28:39.000Z GBP 5 98380000000000000000000000002557 2 268244 2014-11-19T15:28:39.000Z GBP 3 98380000000000000000000000002557 -1 274986 2014-11-20T20:11:06.000Z GBP 371 0 274998 2014-11-20T21:30:34.000Z GBP 372 0 276361 2014-11-21T10:44:12.000Z GBP 375 0 1 276364 2014-11-21T10:44:12.000Z GBP 375 0 -1 280749 2014-11-24T18:08:33.000Z GBP 358 0 285421 2014-11-26T19:21:37.000Z GBP 390 0 291991 2014-11-27T13:37:05.000Z GBP 394 0 291997 2014-11-27T14:36:28.000Z GBP 395 0 292389 2014-11-27T17:22:46.000Z GBP 397 0 296393 2014-11-28T06:23:32.000Z GBP 398 0 301085 2014-11-28T21:17:08.000Z GBP 399 0 302429 2014-12-01T04:33:36.000Z GBP 401 0 302434 2014-12-01T08:43:25.000Z GBP 404 0 1 ```