Re: Pro*C host arrays: how big?

From: Kevin Neel <k-neel_at_nwu.edu>
Date: 24 Jan 1994 21:54:49 GMT
Message-ID: <2i1g39$493_at_anaxagoras.ils.nwu.edu>


In article <CJxpy3.7Cu_at_uk.ac.brookes> Tommy Wareing, p0070621_at_oxford-brookes.ac.uk writes:
.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?
...
. 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>;

Actually, you CAN use dynamically-sized arrays, by declaring your variables as pointers and using the FOR clause of embedded SQL.

However, Oracle does not (or at least did not in the past) understand arrays of structures. In fact, it doesn structures at all. You can use several arrays of scalars.

In general, I think Simon
The copying within your program usually isn prefer to use structures). Received on Mon Jan 24 1994 - 22:54:49 CET

Original text of this message