Pro*C Array Fetch Can Return Too Many Rows
(Doc ID 1335978.1)
Last updated on JANUARY 04, 2020
Applies to:Precompilers - Version 18.104.22.168 and later
Information in this document applies to any platform.
If a Pro*C program has an EXEC SQL SELECT INTO statement that fetches into an array, and is executed many times in a loop, using a different bind value for the WHERE clause, then the number of rows returned can exceed the array size by 1 in certain circumstances.
For example if the array has 50 rows and the query returns 60,55,7,60 rows in subsequent executions, then the number of rows returned is:
query result 60 --> fetches 50 (i.e. size of array).
query result 55 --> fetches 50
query result 7 --> fetches 7
query result 60 --> fetches 51
The problem seems to occur consistently on the execution that follows a query that fetches less than the maximum array size.
The following test program demonstrates this issue:
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document