Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Which C++ to be used for fetching an unlimited number of rows?

scampsdJun 20 2006 — edited Jun 22 2006
Hello,
I am using SQL queries within C++ code.
At the moment, I am doing the following:

while condition
{
EXEC SQL FETCH Query_Name INTO :ora_var1,:ora_var2, ...
}

which copies the query results into the variables ora_var1, ora_var2, ... every time the loop is handled.
But I would like to copy all the rows into a list of variables, something like:

EXEC SQL FETCH Query_Name INTO :ora_list1,:ora_list2, ...

so that I only need to launch one "FETCH" command, which is more performant.

I know this is possible with arrays: by defining ora_list1, ora_list2, ... as an array, I can fetch 10, 20, 100, ... rows at a time.

Unfortunately, I do not know what the maximum number of rows will be, so an array (which has a maximum number of entries by definition) is not answering my question.

Which C++ types or classes could I use?
Thanks
Dominique
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2006
Added on Jun 20 2006
5 comments
347 views