Home » RDBMS Server » Enterprise Manager » formating output
formating output [message #68828] Thu, 28 October 2004 03:28 Go to next message
Budidharma
Messages: 1
Registered: October 2004
Junior Member
Dear experts,

Is it possible to format the output, say like I want to output var x to occupied a certain length using the DBMS_OUTPUT.PUT_LINE?

Your advise is highly appreciated.

Thank you,

Peggy
Re: formating output [message #109262 is a reply to message #68828] Wed, 23 February 2005 01:46 Go to previous message
Neeraj Anurag
Messages: 1
Registered: February 2005
Junior Member
You can use RPAD or LPAD for formating. It works inside dbms_output.put_line.

for eg:

declare
cursor c1
is select proj_id, emp_name from emp_details;
cursor c2 (e_proj_id number,e_emp_name varchar)
is select proj_name, proj_lead from proj_details where proj_id = e_proj_id ;
begin
for c1_cur in c1 loop
for c2_cur in c2(c1_cur.proj_id,c1_cur.emp_name) loop
dbms_output.put_line(rpad(c1_cur.emp_name,10,' ')|| ' ' || c1_cur.proj_id || ' ' || rpad(c2_cur.proj_name,10,' ') || ' '|| c2_cur.proj_lead);
end loop;
end loop;
end;

Hope this solves your problem!!!
Get back to us in case you have any queries

Happy Computing!!!
Previous Topic: Job Dependency in OEM.
Next Topic: Enterprise Manager and Intelligent Agent
Goto Forum:
  


Current Time: Mon May 16 20:05:57 CDT 2022