-
1. Re: VDB Service returns only few records not all
shawkins Jan 10, 2017 8:16 AM (in response to rahulsharma1392)OData paginates by default - see the note about a skipToken OData Support - Teiid 8.12 - Project Documentation Editor
OData client tools should understand this automatically, but manually making the rest calls you have to be aware of the batching behavior.
-
2. Re: VDB Service returns only few records not all
rahulkumarsharma Jan 11, 2017 1:12 AM (in response to shawkins)Thanks for reply.
I have gone throw this. Still facing below issue.
Service URL:
http://localhost:8080/odata/country_vdb/countryServicce.country?$skiptoken=-1
or
http://localhost:8080/odata/country_vdb/countryServicce.country?$skiptoken=256
results:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>ServerErrorException</code><message lang="en-US">String index out of range: -1</message>
</error>
-
3. Re: VDB Service returns only few records not all
rahulkumarsharma Jan 11, 2017 2:01 AM (in response to shawkins)There is another issue which i am facing is:
when i execute VDB using below script:
SELECT * FROM employeeService.employee
it returns me 500 records.
but when i below URL, it returns me only 11 records
http://localhost:8080/odata/employee_vdb/employeeService.employee?$format=json
i don't know why?
Please suggest what to do.
-
4. Re: VDB Service returns only few records not all
rhn-engineering-rareddy Jan 11, 2017 9:13 AM (in response to rahulkumarsharma)1) $skiptoken needs to be a non-negitive number. -1 is not a valid value per OData specification.
2) $skiptoken=256 is valid, however there needs to enough rows in your table to support the query. For example if you only have 10 rows, if you skip 256, your request will end up in error.
On returning 11 records case, that should NOT be the behavior, it should return the all 500 records or whatever the current page size is. If you turn on debug on the server, you can see the query being generated on the Teiid server, which may give further insight into what may be happening. Also when you look at the pay load, if there a entry something like "nexturl" that will also note the pagesizes.
Another recommendation I have is, you seem to be using OData V2 based URL, which is deprecated and was removed in Teiid 9.1 version. Try using OData V4 which is the latest specification. See documentation how the URL changes little bit for V4.
Ramesh..
-
5. Re: VDB Service returns only few records not all
shawkins Jan 11, 2017 3:31 PM (in response to rhn-engineering-rareddy)To clarify, a skipToken is opaque - [MS-ODATA]: Skip Token System Query Option ($skiptoken) which as Ramesh is pointing out this means that it should be determined only from the response message nextLink. Using an arbitrary value is leading to an exception, which we should be providing a better error message for - [TEIID-4695] Provide a better error with an invalid error code - JBoss Issue Tracker