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!

DBMS_OUTPUT.PUT_LINE column output

876003Jul 17 2011 — edited Jul 17 2011
Hello All,

I want to print out 3 columns from a table, First name, Last name and Age using a for loop in pl/sql code.
As some names contain more letters than other, the DBMS_OUTPUT.PUT_LINE output looks like this,

DBMS_OUTPUT.PUT_LINE(‘First Name Last Name Age’);
DBMS_OUTPUT.PUT_LINE();

DBMS_OUTPUT.PUT_LINE (v_fname.firstname || ' ' || v_lname.lastname || ' ' || v_age.age);

First Name Last Name Age
John Smith 32
William Dave 40



What I want is for it to print out the out put line this:

First Name-----------------------------------Last Name---------------------------Age
John-------------------------------------------Smith----------------------------------32
William-----------------------------------------Dave----------------------------------40

of course without the lines I did this to show what i mean as this doesn't support tap.

Can someone please help me with this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2011
Added on Jul 17 2011
2 comments
5,340 views