Pro*C host arrays: how big?

From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: 20 Jan 1994 10:39:06 -0600
Message-ID: <CJxpy3.7Cu_at_uk.ac.brookes>


Software: Oracle 6.0.36, PRO*C 1.4.11.

Anyone know how to transfer data from the database into a PRO*C host array, when the size of the array is not known at compile time?

eg. What I want to do is something along the lines of:

   EXEC SQL SELECT count(*)
   INTO :number_of_rows
   FROM people
   WHERE <whatever>

   people_id_array=(struct *people_id)

                  malloc(number_of_rows*sizeof(struct people_id));

   EXEC SQL SELECT people_id INTO :people_id_array    WHERE <whatever>;

At the moment, I'm just fetching the data one row at a time, and putting it into the array. But when this involves many thousands of records, it includes a heavy load on the database, which I'm beginning to find unacceptable.
Using the normal Array transfer would reduce the load on the database, but it seems to require the use of a temporary array, just so that I know the size at compile time.       

--
  _________________________   ________________________________
 /  Tommy Wareing          \ /  Dying ain't much of a living, \
|  p0070621_at_brookes.ac.uk   X   When you're out and on the run,|
 \  0865-483389            / \  Dying ain't much of a living,  |
  ~~~~~~~~~~~~~~~~~~~~~~~~~   \ When you're young             /
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Thu Jan 20 1994 - 17:39:06 CET

Original text of this message