Solved

Formatting Report in Oracle SQL*Plus

Posted on 2007-12-02
4
928 Views
Last Modified: 2013-12-18
Hello Experts -
How can I do some simple formatting for a report in Oracle outside of just columns?
I'm looking to create a report such as:

                                     TITLE
Attribute1:  Data                                Attribute2:  Data
Attribute3:  Data                                Attribute4:  Data

Attribute 5                                         Attribute6
Data                                                  Data

The Attributes are headings.
Thanks for any help you can provide.
chezbrgrs
0
Comment
Question by:chezbrgrs
  • 2
4 Comments
 
LVL 13

Expert Comment

by:sonicefu
ID: 20393721
Are you using oracle reports ?
0
 

Author Comment

by:chezbrgrs
ID: 20393878
No.  I actually just figured it out...
I put it in the title like:
TTITLE CENTER 'Title' SKIP 3 -
 SKIP 2 LEFT 'Attribute1: ' att1_var -
 RIGHT 'Attribute2: ' att2_var SKIP 1 -
 'Attribute3: ' att3_var -
 RIGHT 'Attribute4: ' att4_var SKIP 2
0
 
LVL 27

Accepted Solution

by:
sujith80 earned 500 total points
ID: 20393926
See the following code snippet as an example. You can play around with the options in the script for further alignments.
ttitle left "                    TITLE" 

set heading off

set trimspool on

set lines 120
 

column depno heading 'Attribute 5';

column dname heading 'Attribute 6';
 

spool c:\spool\test.txt

select 'Attribute1:  '||empno||'         Attribute2:  '||ename||chr(10)||

       'Attribute3:  '||sal  ||'         Attribute4:  '||deptno

from emp where empno = 7788;
 

ttitle off

set heading on

select deptno , dname from dept where deptno = 10;
 

spool off

Open in new window

0
 

Author Comment

by:chezbrgrs
ID: 20397309
That's an even better way.  Thank you.

chezbrgrs
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now