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: proc open cursor

Re: proc open cursor

From: Udo Apolloner <bap_at_carinthia.com>
Date: Tue, 14 Mar 2000 09:19:19 +0100
Message-ID: <38CDF607.93B029E4@carinthia.com>


thank you !
i did not set the release_cursor=yes !
now it works !
i think i must read about the difference between "release_cursor=yes" and "hold_cursor=no"

regards
udo  

Thomas J. Kyte wrote:
>
> In article <38CCA9F5.5C1DCEED_at_carinthia.com>,
> Udo Apolloner <bap_at_carinthia.com> wrote:
> > the hold_cursor is set to no ( proc -?) !
> >
> > some ideas ?
> > thanks udo
> >
>
> pro*c is going to keep one open apparently.
>
> If you set "release_cursor=yes hold_cursor=no" and test with:
>
> main( int argc, char * argv[] )
> {
> char result[255];
>
> EXEC SQL WHENEVER SQLERROR DO sqlerror_hard();
> EXEC SQL CONNECT :USERID;
> printf("\nConnected to ORACLE as user: %s\n\n", USERID);
>
> exec sql declare c cursor for select * from dual;
> exec sql open c;
> exec sql fetch c into :result;
> exec sql close c;
>
> exec sql declare c1 cursor for select username from all_users;
> exec sql open c1;
> exec sql fetch c1 into :result;
> exec sql close c1;
> getchar();
> }
>
> you'll find the last on is the only open one. if you leave off the
> "release_cursor=yes hold_cursor=no", you'll find both are if
> maxopencursors is high enough (it is 10 by default so it should be).
>
> That aside -- you really do want pro*c to cache these cursors for you.
> It is normal to have dozens, if not many many dozens of open cursors.
> If you run a query more then once -- this caching has already paid for
> itself.
>
> --
> Thomas Kyte tkyte_at_us.oracle.com
> Oracle Service Industries
> http://osi.oracle.com/~tkyte/index.html
> --
> Opinions are mine and do not necessarily reflect those of Oracle Corp
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Mar 14 2000 - 02:19:19 CST

Original text of this message

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