Script has 31 Spool commands but only 30 grids are shown

I have a script with 31 queries in it. Before each query, is a spool command to write the output.

spool 1.txt
select .....;
spool 2.txt
select .....;

What I am noticing, when the script ends, I see 31 files in the output directory, but only 30 grids!
Anyone know what might be happening? I'm using Toad for Windows - 64 bit.

Is there anything worth mentioning about the one that didn't make a grid? Was it the first/last one? Did it contain data or was it an empty file? anything else?

It was the last query and the data was complete in the file.

I tried it with simple queries to user_objects, etc and got 31 grids.

Toad 14.0 had a bug where empty grids were skipped but that was fixed for 14.1. I am not sure what else it could be. If you have a demo script that we could reproduce this with, please share it.

Sorry - this is a very specialized script - it is written for a SOX audit for Oracle E business suite. I would be happy to send you the script - but don't want it published.

I sent you a direct message with my email address.

Email sent. It was encrypted.

Just as an FYI I added the spool off line to the end - originally the last line was just "exit"

Hi Eric,

I just tried the script you emailed me on our ebiz db. I got 31 grids on Toad 14.1. If you have a persistent problem with missing grids, let us know and we'll dig deeper.


Its persistent – every time I run it only 30 tabs. Could we get on to a zoom session? Maybe it is an issue with my particular version of oracle client, oracle database, Toad config, and toad patch level?

Toad Config maybe. I don't think Oracle version and client would cause this...esp since output file is getting created.

Does it happen for simpler scripts? (what if you just run the sql that doesn't get a grid all by itself?....or the last 10 instead of all 31?)

If you send me your user files folder (where all your Toad settings are) I'll try again. Instructions on how to do that as well as my email address are here.


Did you run the script as I sent it ending with the SPOOL OFF command?
I hadn't tried that yet - I noticed the last line of the script was EXIT when I received it from the auditors.

I ran the script you emailed me without making any changes.

Thanks. I just created a real simple POC script and it works properly - all 31 tabs and all 31 files are generated.

Maybe it's something about the data returned by last SQL that is preventing its grid from appearing.