Dynamic arrays in embedded pl/SQL

From: NivekD <frozen_ndNOfrSPAM_at_hotmail.com.invalid>
Date: Mon, 24 Jan 2000 21:41:31 -0800
Message-ID: <00091c0e.c84ec591_at_usw-ex0103-020.remarq.com>



Originally posted this over with the C programming discussion and was told I'd probably have better luck here; so here goes:

Using Pro*c and embeded pl/sql (connecting to an oracle database) I'm trying to use dynamic arrays when calling a pl/sql package from my C program, but to no avail (usually a compile error of some sort). If I statically declare my array, no prob.then.
Here is what I'm trying to do:

int array_size = 17;

/* doesn't work :-( */
/* float *my_array = (float *) calloc( array_size, sizeof
(float));*/

/* works!*/

float my_array[17];

EXEC SQL
..
test_fetch.fill_array(:my_array)
..
EXEC END; After extensice discussion with the resident DBA Programmer, I've learned there is nothing wrong with the pl/sql package in the database.

Also, if I compile it with the static array, then copy the generated Pro*C code (from an intermediate file) back into my C program, and edit the static numbers to my variables, I'm actually able to compile and run it. Problem then is my array items are filled with nothing when returned from the pl/sql package.

Any ideas/help/suggestions/reading/web pages would be greatly appreciated.

NivekD

  • Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!
Received on Tue Jan 25 2000 - 06:41:31 CET

Original text of this message