Toad World® Forums

Script Error -- Cursor Expression results in ORA-01000


#1

Can someone explain why when I run this

SELECT
CURSOR
( SELECT ‘Hello’
FROM DUAL
) as str
FROM DBA_OBJECTS;

from Toad via the execute script option I get

ORA-01000: Maximum open cursors exceeded

When I run the same statement and bring it back in the grid no problems.
I’m doing this against an 11r1 database with Toad 10.1.

I suspect I know the answer but would like to get confirmation.


Rumpi Gravenstein


#2

Morning Rumpi,

Can someone explain why when I run this

SELECT
CURSOR
( SELECT ‘Hello’
FROM DUAL
) as str
FROM DBA_OBJECTS;

from Toad via the execute script option I get
ORA-01000: Maximum open cursors exceeded

Each separate row in DBA_OBJECTS is opening a cursor and eventually, you
run out of cursors.

When I run the same statement and bring it back in the grid
no problems. I’m doing this against an 11r1 database with Toad 10.1.
With F5 (Run as script) you are pulling back all results and thus, at
some point, blowing out the OPEN_CURESORS setting.

With F9 you only pull back the number of rows you have configured in
Toad’s options. It is possible that your settings, like mine, are less
than the setting fro OPEN_CURSORS, however, try scrolling down the grid,
or clicking the “go to end” button and it will blow up as expected.

HTH

Cheers,
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk


#3

Argh! I thought I saw different behaviors. My mistake.

– Sent from my Palm Pre


#4

Hi Rumpy,

Argh! I thought I saw different behaviors. My mistake.
You mean I was right! :wink:

Cheers,
Norm. [TeamT]

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk