Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

No sql cursor remaining

818 views
Skip to first unread message

Marcel Lehmann

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hi,

I had the following problem:

I get in a centura application which is connected to oracle the error
message
"sql error : no sql curors remaining. Halt application yes no?"

When I restart the program it works fine. What is the reason for this error?
Can it be a bad network connection ?

Marcel

--
************************************************************
* PC-Soft GmbH * Tel: +49-(0)3573-7075-26 *
* Marcel Lehmann * Fax: +49-(0)3573-7075-19 *
* Softwareentwicklung * Mobil: +49-(0)172/8491395 *
* A.-Hennecke-Str. 37 * e-Mail: mleh...@pcsoft.de *
* 01968 Senftenberg * Internet: http://www.pcsoft.de *
************************************************************

Christian Schubert

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hello Marcel,

could it be your application is wasting sql cursors by overwriting variables
containing connected cursors (i.e. calling SqlConnect with an Sql Handle
which is alrady connected) ? You should pay attention not to do this,
especially loops will rather quick lead to the error you described.

HTH

Christian Schubert

"Marcel Lehmann" <mleh...@pcsoft.de> schrieb im Newsbeitrag
news:8k402r$q4...@horizon.centurasoft.com...

Marc Staudacher

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
In your init.ora parameter-file for the oracle instance you have to
add/increase the value for the parameter 'open_cursors' depending on your
application requirements and concurrent users.

regards,
Marc Staudacher

"Marcel Lehmann" <mleh...@pcsoft.de> wrote in message

Marcel Lehmann

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
this value is set to 100

in the v_$open_cursors are only 10 cursors for the session.

Marcel

--
************************************************************
* PC-Soft GmbH * Tel: +49-(0)3573-7075-26 *
* Marcel Lehmann * Fax: +49-(0)3573-7075-19 *
* Softwareentwicklung * Mobil: +49-(0)172/8491395 *
* A.-Hennecke-Str. 37 * e-Mail: mleh...@pcsoft.de *
* 01968 Senftenberg * Internet: http://www.pcsoft.de *
************************************************************

Marc Staudacher <marc.st...@finesolutions.ch> schrieb in im
Newsbeitrag: 39530CC2@s004...

Marcel Lehmann

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hi,

I don't do this, but I do often the following:

Set bConnect = SqlConnect(hSql)
If bConnect
! Do the sql work
Call SqlDisconnect(hSql)

I do this very often to check the status of a field or something similar.
i.e. In a table window the user can write the number of a customer.
If the focus leave the column, I check if the costumer-nr is valid.
I do this in the way described.

Can that be the reason for the error?

Marcel

Christian Schubert

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hello Marcel,

doing this is not a problem which will waste cursors but if you
connect/disconnect a handle every time the user leaves a field it will be a
waste of time ;-) Connect/ disconnect takes some time especially when you
connect the first cursor to Oracle. Normally it's no problem to connect a
handle on SAM_Create of a window / dialog and disconnect it on SAM_Destroy
and use it in between for several tasks. I've been doing this for years and
never ran into problems with the number of open cursors (except when I was
wasting them as described above).
To make sure you are not wasting any cursors you might want to write your
own function for Disconnect which sets the cursor variable to hWndNull (yes
that's right!) after disconnecting. Then write a function to connect cursors
which checks the cursor variable for anything != hWndNULL and displays a
message if not. You will soon see where's your problem.

HTH

Christian Schubert

"Marcel Lehmann" <mleh...@pcsoft.de> schrieb im Newsbeitrag

news:8k4g2n$qq...@horizon.centurasoft.com...

Marcel Lehmann

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hi Christian,

I'll try it.

Marcel

--
************************************************************
* PC-Soft GmbH * Tel: +49-(0)3573-7075-26 *
* Marcel Lehmann * Fax: +49-(0)3573-7075-19 *
* Softwareentwicklung * Mobil: +49-(0)172/8491395 *
* A.-Hennecke-Str. 37 * e-Mail: mleh...@pcsoft.de *
* 01968 Senftenberg * Internet: http://www.pcsoft.de *
************************************************************

Christian Schubert <schu...@godesys.de> schrieb in im Newsbeitrag:
8k4gii$qr...@horizon.centurasoft.com...

Marcel Lehmann

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Hello Christian,

I tried it but no result.
I forgot to say that this problem only appears by one costumer. All other
costumer work normal with our program.

Know you another reason, which could responsable for this behaviour?

Thanks so far,

raghavan

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
There is a limit of 99 cursors that can be CONCURRENTLY open in any CTD
program. Do you think you are running into this limit ? If your intent is
not to have 99 cursors open at the same time, then, you need to make sure
that you are not inadvertently keeping cursors unnecessarily open.

hth,
raghavan

"Marcel Lehmann" <mleh...@pcsoft.de> wrote in message

news:8k4llc$qq...@horizon.centurasoft.com...

Vladimir

unread,
Jul 19, 2000, 3:00:00 AM7/19/00
to
check your sourcecode - somewhere you do not close cursors
if you declare cursor handle in a function and connect it - it must be
disconnected
in the same level when it declared - it do not deallocates automatically
when function is finished like other types of variables
and also check your SqlImmediate

"Marcel Lehmann" <mleh...@pcsoft.de> wrote in message

news:8k402r$q4...@horizon.centurasoft.com...
> Hi,
>
> I had the following problem:
>
> I get in a centura application which is connected to oracle the error
> message
> "sql error : no sql curors remaining. Halt application yes no?"
>
> When I restart the program it works fine. What is the reason for this
error?
> Can it be a bad network connection ?
>

Marcel Lehmann

unread,
Jul 21, 2000, 3:00:00 AM7/21/00
to
Hi,

we've solved the problem.
A little bug in the programm.
There were two sql handles opened with SqlConnect and closed with SqlClose.
There's the error SqlOpen/SqlClose and SqlConnect/SqlDisconnect are working
together.
Thanks for your advices.

Marcel

0 new messages