# Toad Editor - Output Table Collection

**URL:** <https://forums.toadworld.com/t/toad-editor-output-table-collection/60059>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [October 9, 2024, 6:39pm UTC](https://forums.toadworld.com/t/toad-editor-output-table-collection/60059 "2024-10-09T18:39:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![keith.poulson](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@keith.poulson](https://forums.toadworld.com/u/keith.poulson)\
**Post date:** [October 9, 2024, 6:39pm UTC](https://forums.toadworld.com/t/toad-editor-output-table-collection/60059/1 "2024-10-09T18:39:12Z")

</div>

I am sure there is a way and I am just not doing something correctly. I have a procedure that we send to the application as a table type and not a ref cursor I want to see the output of the collection when I run the procedure but toad is telling me its an unsupported data type. I am sure there is some way I can link the output to the collection so it can show me the output somehow but its not clicking with me.

> [@How to see object type output in TOAD](https://forums.toadworld.com/t/how-to-see-object-type-output-in-toad/34636):
>
> Hi, I have written a procedure and one of the parameter returns a OBJECT, sample below. Sample Procedure: CREATE OR REPLACE PROCEDURE TEST ( IN\_PYMNT\_ID IN TEST\_TABLE.PAYMENT\_ID%TYPE, OUT\_HEADER\_DATA OUT TY\_PAYMENT\_DETAILS\_OBJ\_TBL,… Sample Object: CREATE OR REPLACE TYPE ty\_payment\_details\_obj AS OBJECT (FIELD\_NAME VARCHAR2(300) , FIELD\_VALUE VARCHAR2(300) ); / Sample Table: CREATE OR REPLACE TYPE TY\_PAYMENT\_DETAILS\_OBJ\_TBL IS TABLE OF ty\_payment\_details\_obj / How to execute the p…

I saw this post from 2015 which looked like what I needed but it didn't work (expression is of wrong type when I did the :data\_out call

Not sure if this was still the only way.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 10, 2024, 12:18pm UTC](https://forums.toadworld.com/t/toad-editor-output-table-collection/60059/2 "2024-10-10T12:18:40Z")

</div>

Did you try this option when running the procedure?

If so, and you still got an error, can you provide some sample code so that we can reproduce the problem?

 ![image](https://global.discourse-cdn.com/quest/original/3X/7/6/76e3cdede5256a880bf3961ce90105525dfbcec6.png)

---

<div class="post-metadata">

**Author:** ![keith.poulson](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@keith.poulson](https://forums.toadworld.com/u/keith.poulson)\
**Post date:** [October 10, 2024, 1:24pm UTC](https://forums.toadworld.com/t/toad-editor-output-table-collection/60059/3 "2024-10-10T13:24:16Z")

</div>

I did but since it was a custom collection on the output its like the output window didn't know how to define it.

In the package spec we defined the collection as:  
TYPE t\_mo\_error\_rec IS RECORD  
(  
dsign\_id VARCHAR2(2),  
srch\_val NUMBER,  
user\_message VARCHAR2(200),  
ERROR\_CODE NUMBER,  
error\_message VARCHAR2(250)  
);

```
TYPE t_mo_error_tab IS TABLE OF t_mo_error_rec;

```

Then on the procedure output we output the table.

```
PROCEDURE chk_errors(p_dsign_id IN VARCHAR2,
                     p_srch_val IN NUMBER,
                     p_error_tab OUT t_mo_error_tab);

```

This works and the application that calls the procedure can read the table but I was trying to troubleshoot the procedure and I couldn't easily see my own output so that is where the question comes from.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 10, 2024, 1:52pm UTC](https://forums.toadworld.com/t/toad-editor-output-table-collection/60059/4 "2024-10-10T13:52:02Z")

</div>

Starting from your code (I changed RECORD to OBJECT and filled in enough to make it run) like this, I created the types and procedure.

```auto
drop type t_mo_error_tab;
drop type t_mo_error_rec;

create or replace type t_mo_error_rec as object
(
dsign_id VARCHAR2(2),
srch_val NUMBER,
user_message VARCHAR2(200),
ERROR_CODE NUMBER,
error_message VARCHAR2(250)
);

create or replace tYPE t_mo_error_tab IS TABLE OF t_mo_error_rec;

create or replace
PROCEDURE chk_errors(p_dsign_id IN VARCHAR2,
                     p_srch_val IN NUMBER,
                     p_error_tab OUT t_mo_error_tab) as
BEGIN
  p_error_tab := t_mo_error_tab();
  p_error_tab.EXTEND(2);
  p_error_tab(1) := t_mo_error_rec('a', 1, 'hello', 1, 'hello');
  p_error_tab(2) := t_mo_error_rec('b', 2, 'hi', 2, 'hi');
END;
/

```

And then when I run the procedure from Schema Browser, I get the `unsupported datatype` message in the output.

So, trying Michael's suggestion from the other post, I then did put this in the Editor and ran it with F9:

```auto
declare
  data t_mo_error_tab;
  cur sys_refcursor;
begin
  chk_errors('a', '1', data);
  open cur for select * from table(data);
  :data_out := cur;
end;

```

The variables dialog appeared and I set it like this:

 ![image](https://global.discourse-cdn.com/quest/original/3X/c/5/c5b1a5f754e532613112703643a71858856efbb3.png)

then output appeared in the data grid:  
 ![image](https://global.discourse-cdn.com/quest/original/3X/9/f/9f1905fb33a763e4bcb7dae4292be893385df68a.png)

---

<div class="post-metadata">

**Author:** ![keith.poulson](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@keith.poulson](https://forums.toadworld.com/u/keith.poulson)\
**Post date:** [October 10, 2024, 6:38pm UTC](https://forums.toadworld.com/t/toad-editor-output-table-collection/60059/5 "2024-10-10T18:38:27Z")

</div>

Ok I will go back and try again. I got an error when I did the :data\_out so given the age of the article I wasn't sure that was still correct.
