Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Sudha.

Asked: August 25, 2000 - 12:06 pm UTC

Last updated: August 18, 2020 - 3:21 am UTC

Version: 7.3

Viewed 1000+ times

You Asked

Hi Tom,

Thanks for all your previous help. I have another question to ask you. I need to create a procedure and show the display on
an ASP.

In the procedure I'm creating a cursor and selecting a few records from a table according to a certain criteria.

Declare
c1 cursor is select unit from case where unit like '2%';
c1_rec varchar2(05);
Begin
open c1;
loop
fetch c1 into c1_rec;
exit when c1%notfound;
dbms_output.put_line(c1_rec);
end loop;
close ci;
End;

This works fine on the SQL prompt, but I need to display the output as a table. How do I create a table to store these values and return this table as the out parameter in a procedure ?

I'm new to PL/SQL tables and somebody suggested to use that. How do I go about it ? I need to use %columntype instead of varchar2, number, etc. This is urgent !

Thanks is advance
Sudha


and Connor said...

Head to our Resources section and search for "Results". That will give you some examples of ref cursors.


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

The link is dead.

Stephen Douglas Nelson, August 18, 2020 - 2:53 am UTC

The link is dead. Not really surprising.
Connor McDonald
August 18, 2020 - 3:21 am UTC

Corrected the link.

Thanks for letting us know.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library