Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Record Type. Outputing an entire record using DBMS_output.putline

sharpeJul 13 2010 — edited Jul 13 2010
Hi. I have the following code I've been playing with to better understand Collections. I have a 'how to' question. Is there a way to dbms_output.putline an entire record or will I have to name each and every column as I started to do in the code below?

If there's no single statement for outputing a record, is there a good way to dynamically loop through the record and using dbms_output.putline to output each column without having to name each column explicitly?

Thanks so much for any help.
DECLARE
pc_info_rec performance_clusters%rowtype;

CURSOR C1 IS 
	SELECT * 
	INTO pc_info_rec
	FROM performance_clusters 
	WHERE rownum < 11; 

BEGIN
	OPEN C1;
	LOOP
	FETCH C1 INTO pc_info_rec;
	EXIT WHEN C1%NOTFOUND;

                -- Currently have to name each column in the record, but would prefer a simpler way to output the entire record
		DBMS_OUTPUT.PUT_LINE (pc_info_rec.pc_code||', '||pc_info_rec.zip3);


	END LOOP;
	CLOSE C1;
END; 
/
This post has been answered by Solomon Yakobson on Jul 13 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2010
Added on Jul 13 2010
5 comments
7,365 views