Which C++ to be used for fetching an unlimited number of rows?
scampsdJun 20 2006 — edited Jun 22 2006Hello,
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