?
Solved

Formatting Report in Oracle SQL*Plus

Posted on 2007-12-02
4
Medium Priority
?
935 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Via a live example, show how to take different types of Oracle backups using RMAN.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

770 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