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: OCI related

Re: OCI related

From: Sid <pia_at_e_central.com>
Date: Sat, 11 Apr 1998 19:00:39 GMT
Message-ID: <352fbc9c.6948287@news.santafe.edu>


"L. Nehring" <nehring_at_usa.net> wrote:

<snip>
>Not knowing what you're trying to do, let me just say what I've found....
>IMHO, the only real approach is not to code with that paradigm. If you're
>wanting to know a row count so you can pre-allocate memory for your define
>host variables, I don't think you'll find a method that can avoid a race
>condition. As an alternative, I have typically shoved fetched data into a
>linked list where the links are dynamically allocated one-at-a-time in the
>fetch loop. Or you might use the OCI dynamic defines with callbacks that
>dynamically allocate memory to hold the data.
<snip>

I have this problem as well. Here's a situation where dynamic allocation won't help:

I'm displaying each row of a selected set in a row of a scrollable grid on-screen. Initially, I can fetch enough to fill up the grid (say 20 rows), and place the user at row 1 and the thumbtrack at the top of the vertical scroll bar. Say the user hits the down arrow to go to row 2. How much to I move the scrollbar? If the result set has 21 total rows, I want to move it 1/21 the height of the scrollbar, a visible move. If the result has 20,000 rows, I want to move it 1/20,000 of the height of the scrollbar, which won't even be visible to the user (i.e. the thumbtrack should stay where it is)..

Is there any way to do this without knowing how many rows are in my result set (or doing a separate select count to get that number)?

Thanks,

Sid Gudes
cougar_at_road_runner.com
ANTI-SPAM: remove "_" after "road" when replying Received on Sat Apr 11 1998 - 14:00:39 CDT

Original text of this message

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