# CURSOR FOR LOOP Results to Display in GRID in TOAD

**URL:** <https://forums.toadworld.com/t/cursor-for-loop-results-to-display-in-grid-in-toad/40884>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [May 3, 2018, 12:29pm UTC](https://forums.toadworld.com/t/cursor-for-loop-results-to-display-in-grid-in-toad/40884 "2018-05-03T12:29:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![der0960](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@der0960](https://forums.toadworld.com/u/der0960)\
**Post date:** [May 3, 2018, 12:29pm UTC](https://forums.toadworld.com/t/cursor-for-loop-results-to-display-in-grid-in-toad/40884/1 "2018-05-03T12:29:24Z")

</div>

I would like to write a script containing a CURSOR and FOR LOOP within the standard editor window in TOAD. I want the results to display in the GRID not the DBMS Output tab or SCRIPT output tabs.

Basically I want to write to the data GRID.

Is there a way to do this?

Thank you!

---

<div class="post-metadata">

**Author:** ![frank.diedrich](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@frank.diedrich](https://forums.toadworld.com/u/frank.diedrich)\
**Post date:** [May 4, 2018, 5:46am UTC](https://forums.toadworld.com/t/cursor-for-loop-results-to-display-in-grid-in-toad/40884/2 "2018-05-04T05:46:29Z")

</div>

Hi!

The grid shows only the result of SQL not of PL/SQL. So direct output is not possible afaik.

But why do you need to use the cursor and the for loop, could you not use plain SQL instead?

Another way could betthe use of (pipelined) table function, if the logic of your script reclaims the use of PL/SQL.

BR

fdi

---

<div class="post-metadata">

**Author:** ![der0960](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@der0960](https://forums.toadworld.com/u/der0960)\
**Post date:** [May 4, 2018, 2:49pm UTC](https://forums.toadworld.com/t/cursor-for-loop-results-to-display-in-grid-in-toad/40884/3 "2018-05-04T14:49:05Z")

</div>

HI BR/fdi,

Thank you for your response. I have a CURSOR FOR LOOP since I have to write out 12-15 rows for each one of the rows returned from the cursor.

I now wrote to the DBMS output. There is a “save as” capability that will save the output as a txt file.

That is working for me.

Thank you!
