Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Array fetching in Pro*C

Re: Array fetching in Pro*C

From: Ronald <ronr_at_worldaccess.nl>
Date: 1997/03/30
Message-ID: <ronr-3003971444230001@news.worldaccess.nl>#1/1

In article <5hevop$ddd$1_at_news.connectnet.com>, pmelendez_at_gers.com (Phil Melendez) wrote:

> Ye,
>
> Are both tables in Oracle? If they are it would be a simple thing to
 create a
> database link and select across the link. Or create a snapshot based on the
> remote table.
>
> Phil M.
>
> In article <5f219j$58m_at_physics1.usc.edu>, ysun_at_physics1.usc.edu says...
> >
> >Hi,
> >
> >We are writing an interface to load data from remote database tables to local
> >tables. From remote tables to local, it goes through SQL*NET. So we
> >are trying to do it in a way of best performanence by using host array
> >in Pro*C. However we don't like to use fixed array size for two reasons:
> >1) It is hard to tune at the time of installation;
> >2) Waste too much memory just to hold these big trunck of data.
> >
> >If we use dynamic memory allocation, we have to do malloc for each
 individual
> >element array since Oracle Pro*C precompiler does not take array of
 structures
> >like this:
> > #typedef struct _foo
> > {
> > elmt_1;
> > elmt_2;
> > ...
> > } foo;
> >
> > foo Array[size];
> >
> >Being unable to do this will force us to treat each element
> >individually. This not only makes the programming dreadful with
> >so much mallocs and frees, but also could potentially slow down the
> >process. Neither seems good choice to use.

You can prevent the (calloc&free)'s for individual elements by just creating one basket, which you divide as you like. The programming remains dreadfull.

Success

Ronald

http://www.worldaccess.nl/~ronr (last update march 15. 1997) Received on Sun Mar 30 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US